function moveToEnd(d, h) {
	var p = d[0].offsetHeight,
		n = d.find(".scrollContentBox")[0].offsetHeight,
		q = d.scrollTop();
	(h || 600 > n - q - p) && d.stop().animate({
		scrollTop: n + 1E3
	}, 500)
}
var noSleep = new NoSleep,
	audioObj, closeTipsList = {};
try {
	localStorage.getItem("closeTipsList") && (closeTipsList = JSON.parse(localStorage.closeTipsList))
} catch (d) {}

function rememberCloseTipsList(d) {
	closeTipsList[d] = Date.now();
	localStorage.setItem("closeTipsList", JSON.stringify(closeTipsList))
}
$(function() {
	function d(a, b, c) {
		var e = c;
		a = JSON.stringify({
			data: {
				docId: a,
				amount: Number(b)
			}
		});
		$.ajax({
			type: "POST",
			url: "/doc/api/auth.htm",
			data: a,
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			async: !1,
			success: function(a) {
				200 === a.state.code && (e += "?auth_key=" + a.data.authKey);
				110 === a.state.code && (e = a.data)
			},
			error: function(a) {}
		});
		return e
	}

	function h(a, b, c) {
		var e = c;
		a = JSON.stringify({
			data: {
				docId: a,
				amount: Number(b)
			}
		});
		$.ajax({
			type: "POST",
			url: "/doc/api/auth.htm",
			data: a,
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			async: !1,
			success: function(a) {
				200 === a.state.code && (e = "/static/common/pdf-viewer/viewer.html?url=" + c + "&authKey=" + a.data.authKey);
				110 === a.state.code && (e = a.data)
			},
			error: function(a) {}
		});
		return e
	}

	function p() {
		0 < $("#speakBubbles").children(".left_bubble,.right_bubble,.luckyMoney").length ? $(this).scrollTop() <= s && 1 > $(".qlTimerShow").length ? (x($("#speakBubbles").children(".left_bubble,.right_bubble,.luckyMoney").eq(0).attr("attr-time")), s = 300) : "beginning" != liveFakeStatus && !O && 700 >= $(".speakContentBox")[0].scrollHeight - $(".speakContentBox")[0].scrollTop - $(".speakContentBox")[0].offsetHeight && x($("#speakBubbles").children(".left_bubble,.right_bubble,.luckyMoney").last().attr("attr-time"), "", "after") : $(this).scrollTop() <= s && 1 > $(".qlTimerShow").length && (x(currentTimeMillis), s = 300);
		"beginning" == liveFakeStatus && !ub && currentTimeMillis < startTime && 1 >= $(".speakContentBox")[0].scrollHeight - $(".speakContentBox")[0].scrollTop - $(".speakContentBox")[0].offsetHeight && (ub = !0);
		showBtnToPlayingItem()
	}

	function n(a) {
		$(".page-body").removeClass("textBottom").removeClass("voiceBottom").removeClass("mediaBottom");
		a || $(".page-body").removeClass("mic-replaying")
	}

	function q(a, b, c, e, k) {
		var f;
		/(text)/.test(a) ? f = "mic-text" : /(audioId)/.test(a) ? f = "mic-audio" : /(pcAudio)/.test(a) && (f = "mic-pcAudioUrl");
		0 < $("#waitMicTable.isMicSelf").length ? vb(f, b, c, e, k) : 0 < $(".mic-replaying").length ? (a = $(".mic-replaying").attr("attr-commentId"), vb(f, b, a, e, k)) : D(a, b, c, e, k)
	}

	function D(a, b, c, e, k) {
		if (t) {
			t = !1;
			var f, d = "";
			0 < $("#ppt_slider .active").length ? d = $("#ppt_slider .active").last().data("fileid") : 0 < $("#ppt_slider [data-id]").length && (d = $("#ppt_slider [data-id]").last().data("fileid"));
			if ("" != c) f = "Y";
			else if (f = "N", "" == b.trim()) return alertMsg("内容不能为空", 1, "bottom"), t = !0, !1;
			"text" == a && (b = firstFilter(b), b = normalFilter(b));
			if (2E3 < b.trim().length) return alertMsg("内容字数不能超过2000字", 1, "bottom"), t = !0, !1;
			b = JSON.stringify({
				liveId: liveId,
				commentId: c,
				topicId: topicId,
				type: a,
				content: b,
				second: e,
				creatorRole: currentUserRole,
				fileId: d,
				isReplay: f
			});
			$.ajax({
				type: "POST",
				url: "/live/speak/add.htm",
				data: {
					dataJson: b
				},
				success: function(b) {
					if ("audio" == a || "audioId" == a) $(".recordingSending").hide(), Aa = !0, P = "";
					"200" == b.statusCode ? ("text" == a && ($(".speakInput").val(""), $(".qlSpeakInput").val("")), "Y" == f && ($("#commentDl [attr-id=" + c + "] .right_info").prepend('<i class="btn_iswalled">已上墙</i>'), $("#commentDl [attr-id=" + c + "] .btn_wall").remove(), $(".commentReplyBox").hide()), "beginning" == liveStatus && "ended" == liveFakeStatus ? Ua() : (y(b.liveSpeakView, !1), moveToEnd($(".speakContentBox"), !0))) : "777" == b.statusCode ? ($(".loadingBox").hide(), 0 < $(".recordTemp").length && $(".recordTemp").parents(".left_bubble").remove(), $(document).minTipsBox({
						tipsContent: "微信上传语音异常，请重新录制",
						tipsTime: 1
					})) : ($(".loadingBox").hide(), "405" == b.statusCode ? $(document).minTipsBox({
						tipsContent: b.msg,
						tipsTime: 5
					}) : $(document).minTipsBox({
						tipsContent: "发送失败，请重新发送",
						tipsTime: 1
					}), 0 < $(".recordTemp").length && ($(".btn_resend").show(), $(".btn_resend").parents("dd").addClass("err_resend")));
					"function" == typeof k && k();
					t = !0
				},
				error: function(a) {
					$(".loadingBox").hide();
					$(document).minTipsBox({
						tipsContent: "发送失败",
						tipsTime: 1
					});
					0 < $(".recordTemp").length && ($(".btn_resend").show(), $(".btn_resend").parents("dd").addClass("err_resend"));
					t = !0
				}
			})
		}
	}

	function x(a, b, c, e) {
		var k = "before",
			f = "N";
		wb = void 0 != b && "" != b ? b : "30";
		void 0 != c && "" != c && (k = c);
		Va && (f = "Y");
		Q && (Q = !1, $.ajax({
			type: "GET",
			url: "/live/speak/getSpeak.htm",
			data: {
				liveId: liveId,
				beforeOrAfter: k,
				time: a,
				pageSize: wb,
				topicId: topicId,
				pullComment: f
			},
			success: function(a) {
				if ("200" == a.statusCode) {
					"after" == k && 29 > a.liveSpeakViews.length && (liveFakeStatus = liveStatus);
					for (var b = 0; b < a.liveSpeakViews.length; b++)
					y(a.liveSpeakViews[b], "before" == k ? !0 : !1);
					$("#BubblesTemp .recordingMsg").each(function() {
						xb($(this).parents("dd").attr("attr-id"))
					});
					if ("liveCommentViews" in a && null != a.liveCommentViews) for (b = 0; b < a.liveCommentViews.length; b++) {
						var c = a.liveCommentViews[b];
						1 > $(".commentContentBox [attr-id=" + c.id + "]").length && B(c, !1)
					}
					zan.init();
					Va ? (Va = !1, $(".barrage_tab").eq(0).click(), $("#BubblesTemp").children().appendTo($("#speakBubbles")), Q = !0, "ended" != liveStatus && (powerEntity.allowSpeak && setTimeout(function() {
						moveToEnd($(".speakContentBox"), !0)
					}, 200), nc(), setInterval(l, Wa)), $(".qlLoading").remove(), clearTimeout(relLoadBox), powerEntity.allowSpeak || "charge" === topicType && !isFollowedThird && "Y" != isAuditionOpen || "true" == isLogIn && "ended" != liveStatus && Number(startTime) > Number(currentTimeMillis) && ("Y" != isFocus || !isFollowedThird) && "charge" != topicType && qlSlBoxShow(".enterLiveTips"), setTimeout(function() {
						$(".speakContentBox").scroll(p)
					}, 2E3), addBaiduStatistic()) : ("ended" == liveFakeStatus && 1 > $("#BubblesTemp").children().length && "after" == k && (O = !0, liveFakeStatus != liveStatus && (liveFakeStatus = liveStatus)), setTimeout(function() {
						var a = $("#BubblesTemp")[0].offsetHeight;
						Q = !0;
						var b = $("#BubblesTemp").children(".luckyMoney").length;
						"before" == k ? ($("#BubblesTemp").children().prependTo($("#speakBubbles")), a = a - $("#BubblesTemp")[0].offsetHeight + $(".speakContentBox").scrollTop(), $(".speakContentBox").scrollTop(a)) : $("#BubblesTemp").children().appendTo($("#speakBubbles"));
						Xa("two", b, k)
					}, "after" == k ? 10 : 1E3));
					"function" == typeof e && e()
				} else Q = !0
			},
			error: function() {
				Q = !0
			}
		}))
	}

	function ja(a, b, c) {
		if (!powerEntity.allowMGLive && !powerEntity.allowSpeak && !yb && /(听不到|听不见|没有声音|没声音|加载失败|无法播放)/g.test(b)) yb = !0, $(".input-box").blur(), qlSlBoxShow(".saidNoSound");
		else if (t) {
			t = !1;
			c = c || "N";
			if ("" == b.trim()) return alertMsg("内容不能为空", 1, "bottom"), t = !0, !1;
			"text" == a && (b = firstFilter(b), b = normalFilter(b));
			if (200 < b.trim().length) return alertMsg("内容字数不能超过200字", 1, "bottom"), t = !0, !1;
			$.ajax({
				type: "POST",
				url: "/live/comment/add.htm",
				data: {
					liveId: liveId,
					topicId: topicId,
					type: a,
					content: b,
					isQuestion: c
				},
				success: function(b) {
					t = !0;
					"200" == b.statusCode ? ("text" == a && ($(".askTypeBox").hide(), $(".newCommentBox .input-box").val(""), $(".newCommentBox .input-box").keydown(), $(".newCommentBox .btn_ask").removeClass("on"), $(".commentBox").removeClass("typing")), B(b.liveCommentView, !0), zb(b.liveCommentView, !0), $(".commentContentBox").stop().animate({
						scrollTop: 0
					}, 500)) : "777" == b.statusCode ? (t = !0, $(document).minTipsBox({
						tipsContent: "您已被禁言",
						tipsTime: 1
					}), $(".bottom_content_area").addClass("disabled")) : (t = !0, $(document).minTipsBox({
						tipsContent: b.msg,
						tipsTime: 1
					}))
				},
				error: function() {
					t = !0;
					$(document).minTipsBox({
						tipsContent: data.msg,
						tipsTime: 1
					})
				}
			})
		}
	}

	function R(a, b) {
		ka && (ka = !1, $.ajax({
			type: "GET",
			url: "/live/comment/getComment.htm",
			data: {
				liveId: liveId,
				beforeOrAfter: "before",
				time: a,
				pageSize: "10",
				topicId: topicId
			},
			success: function(a) {
				if ("200" == a.statusCode) {
					for (var c = 0; c < a.liveCommentViews.length; c++) {
						var k = a.liveCommentViews[c];
						1 > $(".commentContentBox [attr-id=" + k.id + "]").length ? (Ya = !1, B(k, !1)) : Ya = !0
					}
					Ya && 1 > $(".commentContentBox .box_nothing").length && $(".commentContentBox .scrollContentBox").append('<div class="box_nothing" style="display:block;"><span class="tips_1">没有更多</span></div>');
					$(".btnLoadComment").removeClass("on");
					ka = !0;
					bg && (bg = !1);
					"function" == typeof b && b()
				} else ka = !0
			},
			error: function() {
				ka = !0
			}
		}))
	}

	function ba(a) {
		var b = "嘉宾";
		return window.liveTopicInviteJsons && 0 < window.liveTopicInviteJsons.length ? (b = window.liveTopicInviteJsons.filter(function(b) {
			return b.userId == a
		}), 0 < b.length ? b[0].title || "" : "嘉宾") : b
	}

	function y(a, b) {
		function c(a) {
			"mic-start" == a ? (la(), (powerEntity.allowSpeak || powerEntity.allowMGLive || 0 < $("#waitMicTable.isMicSelf").length) && $a()) : "mic-end" == a && la()
		}

		function e(a) {
			var b = /((http|https):\/\/)?(\w|\/|\.|-|:|\%)*(\.(com|cn|html|htm|net|org))+(\w|\/|\.|-|:|\%)*(\?+(\w)*.+(\w|\%)*(&+(\w)*.+(\w|\%)*)?)?/gi,
				c;
			if (b.test(a)) {
				c = a.match(b);
				for (ia1 in c)
				a = a.replace(c[ia1], "@lA" + ia1 + "@");
				for (ia2 in c)
				b = /(http|https|ftp)/.test(c[ia2]) ? "" : "http://", a = a.replace("@lA" + ia2 + "@", "<a href='" + b + c[ia2] + "' >" + c[ia2] + "</a>")
			}
			return a
		}
		var k = "left_bubble",
			f = "",
			z = "",
			H = !1,
			L = !1,
			h = a.content,
			l = "",
			m = a.createTime && a.createTime.time ? a.createTime.time : a.createTime,
			m = Number(m),
			g = "https://img.qlchat.com/qlLive/liveCommon/normalLogo.png";
		/^(http)/.test(a.speakCreateByHeadImgUrl) && (g = a.speakCreateByHeadImgUrl);
		/(img\.qlchat\.com)/.test(g) ? g = g.replace(/@.*/, "") + "@64h_64w_1e_1c_2o" : /(wx\.qlogo\.cn\/mmopen)/.test(g) && (g = g.replace(/(\/(0|132|64|96)$)/, "/64"));
		var n = "";
		switch (a.creatorRole) {
		case "guest":
			n = "嘉宾";
			break;
		case "compere":
			n = "特邀主持人";
			break;
		case "topicCreater":
			n = "主持人"
		}
		guestrole = ba(a.createBy);
		/(mic\-text|mic\-audio)/.test(a.type) && (guestrole = "");
		"string" == typeof a.commentId && "" != a.commentId && "string" == typeof a.commentCreateByName && "" == a.commentCreateByName && (L = !0, guestrole += "<b class='blue'>回复：" + a.commentId + "</b>");
		"prompt" == a.type && (a.id = Date.now());
		if (!(!b && "ended" != liveFakeStatus && a.createTime && 0 < $("#speakBubbles").children(".left_bubble,.right_bubble,.luckyMoney").length && Number($("#speakBubbles").children(".left_bubble,.right_bubble,.luckyMoney").last().attr("attr-time")) >= a.createTime) && (" " == a.id || 1 > $(".speakContentBox [attr-id=" + a.id + "]").length)) {
			if ("start" == a.type) $("#qr_bubbles_item").show(), 1 > $(".qlTimerShow").length && (currentTimeMillis < startTime && "ended" != liveStatus ? ($(".qlStartDate").text("本次直播将于" + startDate + "开始"), clearInterval(ab), U = startTime - currentTimeMillis, ab = setInterval(function() {
				U -= 1E3;
				if (0 >= U) clearInterval(ab), $("#fansnowball").remove(), $(".qlStartDate").text("本次直播于" + startDate + "开始"), 0 < $(".ql_start_remind").length && $(".ql_start_remind").remove();
				else {
					$(".qlStartDate").text("距直播开始．");
					var a = parseInt(U / 864E5),
						b = parseInt(U % 864E5 / 36E5),
						c = parseInt(U % 864E5 % 36E5 / 6E4),
						e = parseInt(U % 864E5 % 36E5 % 6E4 / 1E3);
					0 >= a ? ($(".count-down-day-wrap").hide(), $(".count-down-sec-wrap").show()) : $(".count-down-sec-wrap").hide();
					$(".qlDays").text(checkTime(a));
					$(".qlHours").text(checkTime(b));
					$(".qlMinutes").text(checkTime(c));
					$(".qlSeconds").text(checkTime(e))
				}
			}, 1E3)) : ($("#fansnowball").remove(), $(".ql_timer").remove(), $(".qlStartDate").text("本次直播于" + startDate + "开始")), setTimeout(function() {
				$(".qlTopicHeadBox").addClass("qlTimerShow")
			}, 500), 0 < $(".setPasswordTips").length && $(".setPasswordTips").show());
			else if ("end" == a.type && 1 > $(".end_tips").length) bb = !0, f = '<dt class="bubble_dt end_tips" attr-id="' + a.id + '"><b>直播已结束', "Y" == $(".tabTowhisper").attr("attr-whisperask") && (f += '，<a class="over_ask" href="/live/whisper/list.htm?topicId=' + topicId + '">有问题点此处继续问老师</a>'), f += "</b></dt>";
			else if ("redpacket" == a.type) f = '<dt class="luckyMoney" attr-id="' + a.id + '" attr-createby="' + a.createBy + '" attr-time="' + m + '" ><div class="lm_main" attr-myself="' + (a.commentId == userId) + '" attr-imgUrl="' + g + '" attr-money="' + a.rewardMoney + '" attr-response="' + a.rewardResponse + '"> <var>' + a.speakCreateByName + "</var> 赞赏了 <var>" + a.content + "</var> 一个<b>" + (a.rewardMoney / 100).toFixed(2) + "元红包</b></div></dt>";
			else if ("prompt" == a.type)"string" == typeof a.commentType && "mic-text" == a.commentType && (l = "<var>" + a.commentCreateByName + "</var>"), m > currentTimeMillis && (f = '<dt class="bubble_dt" attr-id="' + a.id + '"><b>' + l + "&nbsp;" + a.content + "</b></dt>");
			else if ("mic-end" == a.type) f = '<dt class="bubble_dt" attr-id="' + a.id + '"><b>本次上麦已结束</b></dt>', $(".getMicBox").hide(), $(".qlSpeakTop").css({
				"max-height": "0"
			}), $(".qlSpeakBg").hide();
			else if (/^(text|audio|image|pcAudioUrl|whisper|mic\-audio|mic\-text|mic\-start|mic\-end|video|liveVideo|doc)/.test(a.type)) {
				l = "";
				if (/(audio|pcAudioUrl|mic\-audio)/.test(a.type)) {
					var l = "recordingMsg",
						u = a.second;
					12 >= u ? l += " recordwid1" : 0 < u && 24 >= u ? l += " recordwid2" : 24 < u && 36 >= u ? l += " recordwid3" : 36 < u && 48 >= u ? l += " recordwid4" : 48 < u && 60 >= u && (l += " recordwid5")
				}
				/^(image|video|liveVideo)/.test(a.type) && (l += " img_bubble");
				/^(text|audio)/.test(a.type) && (l += " green_bubble");
				if ("whisper" == a.type || "mic-text" == a.type || "mic-audio" == a.type) k = "right_bubble";
				if ("doc" == a.type) l = "doc";
				else if ("mic-start" == a.type || "mic-end" == a.type) l = a.type;
				0 < $(".scrollContentBox .hasTime").length ? (u = 0 < $("#BubblesTemp .hasTime").length ? $("#BubblesTemp .hasTime") : $("#speakBubbles .hasTime"), b ? 12E4 <= Number(u.eq(0).attr("attr-time")) - a.createTime && (k += " hasTime", z = a.createTimeView) : 12E4 <= a.createTime - Number(u.last().attr("attr-time")) && (k += " hasTime", z = a.createTimeView)) : (k += " hasTime", z = a.createTimeView);
				"" != z && (u = new Date, u = Date.parse(u.getFullYear() + "-" + checkTime(u.getMonth() + 1) + "-" + checkTime(u.getDate())), a.createTime >= Number(u) && (z = z.substr(6, 11)));
				u = "";
				/\.gif$/.test(a.content) && (u = '<span class="gifShadow"><b>GIF</b></span>');
				f = '<dd class="' + k + '" attr-id="' + a.id + '" data-fileid="' + a.fileId + '" attr-time="' + m + '" attr-createby="' + a.createBy + '"><div class="speak_time">' + z + '</div><div class="head_portrait"><img src="' + g + '"></div><div class="speaker_name"><b>' + a.speakCreateByName + "</b>" + guestrole + '</div><div class="bubble_content ' + l + '"><div class="bubble_content_main">' + (powerEntity.allowDelSpeak || a.createBy == userId ? "" : "audio" == a.type ? '<div class="icon_checked"> </div>' : "") + u;
				if (!L && "" != a.commentId && null != a.commentId) switch (f += "<p><b>" + a.commentCreateByName + ":</b>", "Y" == a.isReplyQuestion && (f += '<em class="ask_label">问</em>'), a.commentType) {
				case "text":
					f += a.commentContent + "</p>";
					break;
				case "image":
					f += '<img src="' + a.commentContent + '"></p>'
				}
				switch (a.type) {
				case "mic-text":
				case "text":
					"" != a.content && (h = h.replace(/ /g, "&nbsp;"), h = e(h), h = h.replace(/\n|\r|(\r\n)|()|()|()/g, "<br>"), f = L || "" == a.commentId || null == a.commentId ? f + ("<p>" + h + "</p>") : f + ("<p><b>回复:</b>" + h + "</p>"));
					break;
				case "image":
					null != a.content && (f += '<img src="' + a.content.replace(/@.*/, "") + '@240h_1e_1c_2o">');
					break;
				case "mic-audio":
				case "audio":
					f += '<i class="audio_info icon_audio_play" attr-src="' + (a.content ? a.content.replace("img.skg.com", "media.qlchat.com") : "") + '"></i><span class="audio-bar-area"><span class="front-bar"></span><span class="block" data-second="' + a.second + '" data-current="0″"><b></b></span></span><var>' + convertSecond(a.second) + "</var>";
					break;
				case "pcAudioUrl":
					f += '<i class="audio_info icon_audio_play" attr-src="' + a.content + '"></i><span class="audio-bar-area"><span class="front-bar"></span><span class="block" data-second="' + a.second + '" data-current="0″"><b></b></span></span><var>' + convertSecond(a.second) + "</var>";
					break;
				case "video":
					/(qq\.com)|(youku\.com)/.test(a.content) && (L = a.content, /(https)/.test(window.location.href) && (L = L.replace(/(http:\/\/)/, "https://")), f += '<iframe frameborder="0" id="imIf" name="imIf" src="' + L + '" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>');
					v && (f += '<div class="play_video"></div>');
					break;
				case "liveVideo":
					L = "/styles/wtwap/video/videoIframe.html?url=" + a.content;
					f += '<iframe frameborder="0" id="imIf" name="imIf" src="' + L + '" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>';
					break;
				case "doc":
					var p = a.createBy;
					(function(a) {
						var b = JSON.stringify({
							data: {
								docId: a
							}
						});
						$.ajax({
							type: "POST",
							url: "/doc/api/one.htm",
							data: b,
							contentType: "application/json; charset=utf-8",
							dataType: "json",
							async: !1,
							success: function(b) {
								if (200 === b.state.code && (b = b.data, void 0 !== b)) {
									var c, e;
									c = convertSize(b.size);
									var k = (Number(b.amount) / 100).toFixed(2),
										z = "javascript:;";
									if (b.isPaid || 0 === b.amount || powerEntity.allowMGLive) b.convertUrl = d(a, b.amount, b.convertUrl), z = b.convertUrl;
									c = '<span style="background-image:url(' + b.icon + ')"></span><section data-fileimage="' + b.icon + '" data-filename="' + b.name + '" data-filesize="' + b.size + '" data-url="' + b.convertUrl + '" data-type="' + b.type + '" data-download="' + b.downloadCount + '" data-uploadtime="' + b.createTime + '" data-charge="' + b.amount + '" data-haspay="' + b.isPaid + '" data-docid="' + a + '"><h1 class="multi-elli">' + b.name + "</h1><p>" + c + "</p></section>";
									e = b.isPaid ? '<p class="paid">已支付<span>￥' + k + "</span><i>点击下载</i></p>" : "<p>支付<span>￥" + k + "</span><i>立即下载</i></p>";
									if (p === userId || powerEntity.allowMGLive) e = '<p class="paid">￥' + k + "<span></span><i>点击下载</i></p>";
									0 === Number(b.amount) && (e = "<p>免费<span></span><i>立即下载</i></p>");
									f += '<a class="download-link" href="' + z + '"><main class="file-msg">' + c + e + "</main></a>"
								}
							},
							error: function(a) {}
						})
					})(a.content);
					break;
				case "mic-start":
					f += '<p>点击抢麦发言 <var class="mic-num">' + a.content + '</var></p><span class="mic-second"></span><span class="mic-btn"><i class="icon_upmic"></i></span>'
				}(powerEntity.allowSpeak || powerEntity.allowMGLive) && /(mic\-text|mic\-audio)/.test(a.type) && (H = !0);
				f += "</div>";
				if ("mic-start" != a.type && "mic-end" != a.type) {
					zan.addIds(Number(a.id));
					f += '<div class="play-box"><div class="zan" data-id="' + a.id + '"><b class="icon_praise"></b><span class="count"></span></div>';
					if (powerEntity.allowDelSpeak || a.createBy == userId && !/(mic\-text|mic\-audio)/.test(a.type)) f = /(mic\-text|mic\-audio)/.test(a.type) ? f + ('<a class="btn_revoke" href="javascript:;" onMicSpeak="' + H + '">撤销</a>') : f + ('<a class="btn_revoke" href="javascript:;" onMicSpeak="' + H + '">撤回</a>');
					"mic-text" != a.type && "mic-audio" != a.type || !powerEntity.allowSpeak || "Y" == isrelay || (f += '<a href="javascript:;" class="micReply">回复</a>');
					f += "</div>"
				}
				f += "</div>";
				"Y" != percentageRule.isEnable || /(mic|whisper)/.test(a.type) || (f += '<a class="btn_ilike" href="javascript:;">赏</a>');
				f += "</dd>";
				if ("whisper" == a.type) {
					H = "";
					switch (a.answerRole) {
					case "guest":
						H = "嘉宾";
						break;
					case "compere":
						H = "特邀主持人";
						break;
					case "topicCreater":
						H = "主持人"
					}
					H = ba(a.createBy) || H;
					f = '<dd class="whisperDd ' + k + '" attr-id="' + a.id + '" attr-commentId="' + a.commentId + '" attr-createby="' + a.createBy + '" attr-time="' + m + '" ><div class="speak_time">' + z + '</div><div class="head_portrait"><img src="' + (a.commentcreateByHeadImgUrl ? a.commentcreateByHeadImgUrl : g) + '"></div><div class="speaker_name">' + n + "<b>" + a.commentCreateByName + '</b></div><div class="bubble_content isWhisper"><div class="bubble_content_main"><p><i>' + H + "</i><var>" + a.speakCreateByName + '</var>回复了</p><p class="content_q">' + a.content + '<i>点击听回答</i></p><div class="whisper_div"><span>私问</span><i class="icon_question"></i></div></div></div></dd>'
				}
			}
			b ? $("#BubblesTemp").prepend(f) : ("audio" == a.type && "" != a.mediaId && 0 < $(".left_bubble[qlWxSevId=" + a.mediaId + "]").length ? ($(".left_bubble[qlWxSevId=" + a.mediaId + "]").after(f), $(".left_bubble[qlWxSevId=" + a.mediaId + "]").remove()) : "ended" == liveFakeStatus ? $("#BubblesTemp").append(f) : $("#speakBubbles").append(f), "audio" == a.type && E && "beginning" == liveFakeStatus && 1 > $(".isPlaying").length && 1 > $(".isWhisperPlay").length && ca($(".recordingMsg:last"), "newAudio"));
			c(a.type)
		}
	}

	function B(a, b) {
		$("#loadNone").removeClass("none_record").hide();
		if (1 > $(".commentContentBox [attr-id=" + a.id + "]").length) {
			var c = "https://img.qlchat.com/qlLive/liveCommon/normalLogo.png";
			/(img\.qlchat\.com)/.test(a.createByHeadImgUrl) ? (c = a.createByHeadImgUrl, c = c.replace(/@.*/, "") + "@64h_64w_1e_1c_2o") : /(wx\.qlogo\.cn\/mmopen)/.test(a.createByHeadImgUrl) && (c = a.createByHeadImgUrl, c = c.replace(/(\/(0|132|64|96)$)/, "/64"));
			var e = "";
			if (a.voteType) switch (a.voteType) {
			case "likes":
				e = "liked";
				break;
			case "despise":
				e = "hated"
			}
			e = '<dd class="comment_dd ' + e + '" attr-id="' + a.id + '" attr-time="' + a.createTime + '" attr-createby="' + a.createBy + '"><span class="right_info">';
			if (powerEntity.allowReplyComment && "beginning" == liveStatus) switch (a.isReplay) {
			case "N":
				e += '<i class="btn_wall">上墙</i> ';
				break;
			case "Y":
				e += '<i class="btn_iswalled">已上墙</i> '
			}
			e += '<i class="btn_like">' + a.likesNum + '</i> <i class="btn_hate">' + a.despiseNum + "</i></span>";
			e = "ended" != liveStatus ? e + ('<a class="avatar"><img class="hasTempHead" attr-realSrc="' + c.replace(/(\/(0|132|64|96)$)/, "/64") + '" src="https://img.qlchat.com/qlLive/liveCommon/normalLogo.png"/></a>') : e + ('<a class="avatar"><img src="' + c.replace(/(\/(0|132|64|96)$)/, "/64") + '"/></a>');
			e += '<span class="author_name">' + a.createByName + (a.isVip ? '<a class="vip-logo" href="/live/whisper/vip.htm?liveId=' + window.liveId + '"></a>' : "") + '</span><b class="time">' + a.createTimeView + "</b>";
			if (powerEntity.allowDelSpeak || a.createBy == userId) e += '<i class="commentManage">管理<span class="commentManageTab" style="display:none;"><a class="delCommentMsg">删除</a>', powerEntity.allowMGBanned && (e += '<a class="shutUpSet">禁言</a>'), e += "</span></i>";
			e += '<p class="content">';
			"Y" == a.isQuestion && (e += '<em class="ask_label">问</em>');
			switch (a.type) {
			case "text":
				e += wordFilter(a.content);
				break;
			case "image":
				e += '<img src="' + a.content + '">'
			}
			e += "</p></dd>";
			b ? 0 < $("#commentDl").children().length ? $("#commentDl .comment_dd:first").attr("attr-time") < a.createTime && $("#commentDl").prepend(e) : $("#commentDl").prepend(e) : $("#commentDl").append(e)
		}
	}

	function l() {
		if (0 < $(".hasTempHead").length) {
			Wa = 200;
			var a = $(".hasTempHead").eq(0),
				b = a.parents("dd").attr("attr-id"),
				c = a.attr("attr-realSrc");
			a.attr("src", c);
			0 < $(".danmulist [attr-id=" + b + "]").length && $(".danmulist [attr-id=" + b + "]").find("img").attr("src", c);
			a.removeClass("hasTempHead")
		} else Wa = 1E3
	}

	function Ab(a) {
		if (0 < $("#commentDl [attr-id=" + a.commentId + "]").length) {
			var b = $("#commentDl [attr-id=" + a.commentId + "]");
			b.find(".btn_like").text(a.liveCommentPo.likesNum);
			b.find(".btn_hate").text(a.liveCommentPo.despiseNum);
			if (a.id == userId) switch (a.voteType) {
			case "likes":
				b.addClass("liked").removeClass("hated");
				break;
			case "despise":
				b.addClass("hated").removeClass("liked")
			}
		}
	}

	function Ba(a, b) {
		if (0 < bh.length) {
			$(".loadingBox").show();
			var c = bh.shift();
			wx.uploadImage({
				localId: c,
				isShowProgressTips: 0,
				success: function(c) {
					switch (a) {
					case "normal":
						D("imageId", c.serverId, "", "", Ba(a, b));
						break;
					case "pptMode":
						Bb("mobile", c.serverId, b, Ba(a, b))
					}
				},
				fail: function(a) {
					$(".loadingBox").hide();
					$(document).minTipsBox({
						tipsContent: "部分图片上传失败，请重新选择",
						tipsTime: 1
					})
				}
			})
		} else $(".loadingBox").hide()
	}

	function cb(a, b) {
		$.ajax({
			type: "POST",
			url: "/live/speak/speakMg.htm",
			data: {
				speakId: a,
				topicId: topicId,
				createBy: b
			},
			success: function(b) {
				"200" == b.statusCode ? Cb(a) : "205" == b.statusCode && alertMsg(b.msg)
			},
			error: function(a) {
				alertMsg(a.msg)
			}
		})
	}

	function Db(a, b, c) {
		$.ajax({
			type: "POST",
			url: "/live/comment/commentMg.htm",
			data: {
				commentId: a,
				topicId: topicId,
				createBy: b
			},
			success: function(b) {
				"200" == b.statusCode ? (Eb(a), "function" === typeof c && c()) : "205" == b.statusCode && alertMsg(b.msg)
			},
			error: function(a) {
				alertMsg(a.msg)
			}
		})
	}

	function Fb(a, b) {
		$.ajax({
			type: "POST",
			url: "/live/entity/updateBlackList.htm",
			data: {
				liveId: liveId,
				userId: a,
				isEnable: "Y",
				type: "banned"
			},
			success: function(a) {
				"200" == a.statusCode ? "function" === typeof b && b() : alertMsg(a.msg);
				$(".loadingBox").hide()
			},
			error: function(a) {
				alertMsg(a.msg)
			}
		})
	}

	function Cb(a) {
		0 < $("#speakBubbles [attr-id=" + a + "]").length && (0 < $("#speakBubbles [attr-id=" + a + "] .recordingMsg.isPlaying").length && (Da = !0, m.pause(), F.attr("src", ""), V(), userId != $("#speakBubbles [attr-id=" + a + "] .recordingMsg.isPlaying").attr("attr-createby") && alertMsg("正在播放的语音已被撤销")), $("#videoIframe").attr("attr-id") == a && ($("#videoIframe").attr({
			src: "",
			"attr-id": ""
		}), $(".videoPreview").hide(), alertMsg("该视频已被撤回")), $("#speakBubbles [attr-id=" + a + "]").remove(), 1 > $("#speakBubbles").children(".left_bubble,.right_bubble,.luckyMoney").length && Ua())
	}

	function Eb(a) {
		0 < $("#commentDl [attr-id=" + a + "]").length && $("#commentDl [attr-id=" + a + "]").remove();
		0 < $(".danmulist [attr-id=" + a + "]").length && $(".danmulist [attr-id=" + a + "]").remove();
		1 > $("#commentDl dd").length && ($("#loadNone").show(), $(".box_nothing").hide())
	}

	function Gb(a) {
		var b = a.speaker,
			c = a.status;
		msgTime = a.createTime || currentTimeMillis + 1E3;
		"Y" == c && myName != b && msgTime >= currentTimeMillis && ($("#input_person_name").html(wordFilter(b)), $(".inputing_areowindow").stop().show(100), clearTimeout(bi), bi = setTimeout(function() {
			$(".inputing_areowindow").stop().hide(100)
		}, 1E4))
	}

	function ma(a, b) {
		db && (db = !1, setTimeout(function() {
			db = !0
		}, 1E4), $.ajax({
			type: "post",
			url: "/live/topic/changespeaker.htm",
			data: {
				topicId: topicId,
				speaker: a,
				status: b
			},
			success: function(a) {},
			error: function(a) {}
		}))
	}

	function I() {
		$(".recording_click .btn_dd").removeClass("stopRec").removeClass("startRec")
	}

	function Ea(a) {
		var b = A;
		Aa = !1;
		1 > $(".isOnMic").length && oc(a, b);
		1 > b && (b = 1);
		W(!0);
		$(".speakBottom").removeClass("recording");
		I();
		$(".recordingTips").hide();
		$(".recing_bg").hide();
		60 <= b && 0 < $(".voiceBottom").length && 1 > $(".changeRecType").length && 2 > $(".recordTemp").length ? (S = !0, $(".loadingBox").hide(), setTimeout(function() {
			$("#btnStartRec").click()
		}, v ? 500 : 0)) : r && (wx.playVoice({
			localId: a
		}), wx.stopVoice({
			localId: a
		}));
		bj ? (bj = !1, setTimeout(function() {
			wx.uploadVoice({
				localId: a,
				isShowProgressTips: 0,
				success: function(c) {
					var e = c.serverId;
					$(".left_bubble[qlWxLoaclId='" + a + "']").attr("qlWxSevId", c.serverId);
					60 == b && 1 > $(".changeRecType").length && (t = !0);
					q("audioId", e, "", b, function() {
						S = !0;
						$(".loadingBox").hide()
					})
				},
				complete: function(a) {
					bj = !0
				},
				fail: function(b) {
					$(document).minTipsBox({
						tipsContent: "发送失败",
						tipsTime: 1
					});
					$(".left_bubble[qlWxLoaclId='" + a + "']").find(".btn_resend").show();
					$(".left_bubble[qlWxLoaclId='" + a + "']").addClass("err_resend")
				},
				cancel: function(a) {
					bj = !0;
					$(".btn_resend").last().show();
					$(".btn_resend").last().parents("dd").addClass("err_resend")
				}
			})
		}, 200)) : 0 < $(".recordTemp").length && ($(".btn_resend").last().show(), $(".btn_resend").last().parents("dd").addClass("err_resend"));
		$(".second_dd var").text("0")
	}

	function oc(a, b) {
		if (1 > $(".left_bubble[qlWxLoaclId='" + a + "']").length) {
			var c = "";
			12 >= b ? c += " recordwid1" : 24 >= b ? c += " recordwid2" : 36 >= b ? c += " recordwid3" : 48 >= b ? c += " recordwid4" : 60 >= b && (c += " recordwid5");
			a = '<dd class="left_bubble hasTime" qlWxLoaclId="' + a + '"><div class="speak_time">刚刚</div><div class="head_portrait"><img src="' + myHead + '"></div><div class="speaker_name"><b>' + myName + '</b></div><div class="bubble_content recordTemp green_bubble' + c + '"><div class="bubble_content_main"><i class="audio_info icon_audio_play" ></i> <span class="sending">发送中...</span>  <var>' + b + '</var></div></div><a class="btn_resend icon_warning" href="javascript:;"></a></dd>';
			$("#speakBubbles").append(a);
			moveToEnd($(".speakContentBox"), !0)
		}
	}

	function eb(a) {
		G = !1;
		isRecording = !0;
		P = a;
		clearInterval(J);
		60 < A && (A = 60);
		I();
		ma(myName, "N");
		if (r || v) try {
			noSleep.enable()
		} catch (b) {}
		$(".recordingTips").hide();
		1 > $(".isOnMic").length ? ($(".speakBottom").removeClass("recording"), $(".recing_bg").hide(), $("#btnRecording").removeClass("on"), Ea(a)) : $(".recording_click .btn_dd").addClass("stopRec")
	}

	function Ib() {
		A++;
		60 < A && (A = 60);
		$(".second_dd var").text(A);
		50 <= A && ($(".rTips_1").hide(), $(".rTips_2").show(), $(".rTips_2 var").text(60 - A));
		60 <= A && G ? (wx.stopRecord({
			success: function(a) {
				eb(a.localId)
			},
			complete: function(a) {},
			fail: function(a) {
				$(document).popBox({
					boxContent: "录音失败",
					btnType: "confirm"
				});
				oa()
			}
		}), clearInterval(J)) : ma(myName, "Y")
	}

	function oa() {
		W(!0);
		$("#btnCheckRec").text("试听").removeClass("btn_pause");
		S = !0;
		G = !1;
		$(".second_dd var").text("0");
		$(".speakBottom").removeClass("recording");
		$(".recordingTips").hide();
		$(".recing_bg").hide();
		I();
		clearInterval(J);
		wx.stopRecord({
			complete: function(a) {}
		})
	}

	function W(a) {
		a ? ($("#btnCancelRec").hide(), $("#btnAddMic").show()) : ($("#btnCancelRec").show(), $("#btnAddMic").hide())
	}

	function ca(a, b) {
		if (fb) fb = !1, setTimeout(function() {
			fb = !0
		}, 500);
		else return !1;
		Da = !1;
		b && (bm = b);
		Fa++;
		3 < Fa && 0 < $(".top_follow_tips").length && !closeTipsList[topicId] && $(".top_follow_tips").show();
		30 < Fa && 0 < $(".top_follow_tips").length && !Kb && (_qla && _qla("event", {
			category: "nofollowAfterListen",
			action: "success",
			businessId: topicId,
			playTimes: Fa
		}), Kb = !0);
		a.addClass("isReading");
		X && clearInterval(X);
		pc(a.parents("dd").attr("attr-id"));
		rememberLastReaded(a.parents("dd").attr("attr-time"), a.parents("dd").attr("attr-id"));
		m.pause();
		if (a.hasClass("isPlaying")) Da = !0, m.pause(), V();
		else {
			V();
			a.addClass("isPlaying");
			g = a.find(".audio_info").attr("attr-src");
			/(\.mp3)/.test(g) ? F.attr("preload", "meta") : (F.attr("preload", "auto"), g = g.replace(/(\.amr)|(\.aac)/gi, "") + gb);
			audioCurrentSrc = m.currentSrc;
			m.pause();
			audioCurrentSrc.replace(/(\?.*)/, "") != g && (r && /(\.mp3)/.test(g) ? (F.attr("src", g + "?again=" + (new Date).getTime()), $(".gat").attr("src", g + "?again=" + (new Date).getTime())) : (F.attr("src", g), $(".gat").attr("src", g)));
			a.addClass("audioloading");
			a.addClass("isPlaying");
			m.volume = 1;
			bl.play();
			setTimeout(function() {
				bl.pause();
				m.play()
			}, 300);
			0 < $(".pptMode").length && a.parents("dd").data("fileid") && 0 < $("#ppt_slider [data-fileid=" + a.parents("dd").data("fileid") + "]").length && (b = $("#ppt_slider [data-fileid=" + a.parents("dd").data("fileid") + "]").index(), K.jumpToSlide(b));
			b = $(".speakContentBox")[0].offsetHeight;
			var c = $(".speakContentBox")[0].scrollTop;
			a = a.parents("dd")[0].offsetTop;
			(a > b + c - 100 || a < c + 100) && $(".speakContentBox").stop().animate({
				scrollTop: a - b / 2 + 50
			}, 500)
		}
	}

	function V() {
		0 < $(".isPlaying").length && ($(".isPlaying").removeClass("isReading").addClass("isReaded").add("i"), $(".isPlaying").removeClass("audioloading").removeClass("isPlaying"))
	}

	function qc(a, b, c) {
		$.ajax({
			type: "get",
			url: "//stat.corp.qlchat.com/media.gif",
			data: {
				url: a.currentTarget.currentSrc,
				status: c,
				playType: bm,
				errorCodeMsg: b
			},
			success: function(a) {},
			error: function(a) {}
		})
	}

	function xb(a) {
		bn[a] && $(".left_bubble[attr-id=" + a + "]").find(".recordingMsg").addClass("isReaded")
	}

	function pc(a) {
		bn[a] || (bn[a] = (new Date).getTime(), localStorage.setItem("recordReaded", JSON.stringify(bn)))
	}

	function Lb(a) {
		0 < $(".luckyMoney[attr-id='" + a.id + "']").length && $(".luckyMoney[attr-id='" + a.id + "']").find(".lm_main").attr("attr-response", a.rewardResponse)
	}

	function Mb() {
		bo = new imgUpload($("#btnUploadMP3"), {
			folder: "audio",
			onComplete: function(a, b) {
				$(".audioProgress").hide();
				$(".loadingBox").show();
				D("pcAudioUrl", a, "", b, function() {
					$(".loadingBox").hide()
				})
			},
			onChange: function() {
				$(".audioProgress var").text("0");
				qlSlBoxShow(".audioProgress")
			},
			onError: function() {
				$(".audioProgress").hide();
				$(".loadingBox").hide()
			},
			uploadType: function() {
				return "mp3"
			},
			progress: function(a) {
				$(".audioProgress var").text(Math.floor(100 * a))
			}
		})
	}

	function Ob(a, b, c, e) {
		bp && (bp = !1, isWeixin() && (isiOS() || isAndroid()), M = "REWARD", Ga(M, b, a, "", "", ""))
	}

	function Ga(a, b, c, e, k, f, d) {
		var z = topicId;
		"" == topicId && (z = "0");
		$(".loadingBox").show();
		$.ajax({
			type: "POST",
			url: "/live/pay/UnifiedOrder.htm",
			data: {
				ifboth: "Y",
				type: a,
				byUserId: b,
				total_fee: c,
				topicId: z,
				questionId: e,
				questionPerson: k,
				isWall: f,
				docId: d
			},
			success: function(a) {
				"200" == a.statusCode ? isiOS() || isAndroid() ? "undefined" == typeof WeixinJSBridge ? document.addEventListener ? document.addEventListener("WeixinJSBridgeReady", Ha, !1) : document.attachEvent && (document.attachEvent("WeixinJSBridgeReady", Ha), document.attachEvent("onWeixinJSBridgeReady", Ha)) : (Pb(a.qcodeUrl, a.qcodeId), Ha(a)) : ($(".loadingBox").hide(), Pb(a.qcodeUrl, a.qcodeId), qlSlBoxShow(".payQrBox"), $(".payQrBox .kuaSpan").hide(), $(".redbagBox").hide(), T = bp = !0) : ($(document).minTipsBox({
					tipsContent: a.msg,
					tipsTime: 1
				}), T = sendAQ = !0, $(".loadingBox").hide())
			},
			error: function(a) {
				$(document).minTipsBox({
					tipsContent: a.msg,
					tipsTime: 1
				});
				T = sendAQ = !0;
				$(".loadingBox").hide()
			}
		})
	}

	function Pb(a, b) {
		void 0 !== a && ($(".payQrBox .payQrPic").attr("src", "https://pan.baidu.com/share/qrcode?w=300&h=300&url=" + a), setTimeout(function() {
			Qb(b)
		}, 10))
	}

	function Qb(a) {
		Ia = setTimeout(function() {
			$.ajax({
				type: "POST",
				url: "/live/selectPayResult.htm",
				data: {
					orderID: a
				},
				success: function(b) {
					"200" == b.statusCode ? "SUCCESS" == b.msg ? ($(".payQrBox").hide(), $(document).minTipsBox({
						tipsContent: "支付成功",
						tipsTime: 1
					}), payTrace({
						id: topicId,
						type: "topic",
						payType: M
					}), clearTimeout(Ia), "DOC" === M && hb()) : (clearTimeout(Ia), $(document).minTipsBox({
						tipsContent: "支付失败",
						tipsTime: 1
					})) : "1" == b.statusCode && Qb(a)
				},
				error: function(a) {
					$(document).minTipsBox({
						tipsContent: a.msg,
						tipsTime: 1
					})
				}
			})
		}, 3E3)
	}

	function Ha(a) {
		WeixinJSBridge.invoke("getBrandWCPayRequest", {
			appId: a.appId,
			timeStamp: a.timeStamp,
			nonceStr: a.nonceStr,
			"package": a.packageValue,
			signType: a.signType,
			paySign: a.paySign
		}, function(a) {
			if ("get_brand_wcpay_request:ok" == a.err_msg) switch ($(".loadingBox").hide(), payTrace({
				id: topicId,
				type: "topic",
				payType: M
			}), M) {
			case "REWARD":
				$(document).minTipsBox({
					tipsContent: "赞赏成功",
					tipsTime: 1
				});
				$(".redbagBox").hide();
				$(".payQrBox").hide();
				bp = !0;
				moveToEnd($(".speakContentBox"), !0);
				break;
			case "LISTEN":
				T = !0;
				$(document).minTipsBox({
					tipsContent: "支付成功",
					tipsTime: 1
				});
				payForListenItem.find(".audio_box p").text("点击播放");
				$(".feedback_box").show();
				break;
			case "DOC":
				hb()
			} else "get_brand_wcpay_request:cancel" == a.err_msg ? ($(".loadingBox").hide(), $(document).minTipsBox({
				tipsContent: "已取消付费",
				tipsTime: 1
			}), T = bp = !0) : "get_brand_wcpay_request:fail" == a.err_msg && ($(".loadingBox").hide(), qlSlBoxShow(".payQrBox"), $(document).minTipsBox({
				tipsContent: "请使用微信二维码支付",
				tipsTime: 1
			}), $(".redbagBox").hide(), T = bp = !0)
		})
	}

	function rc(a) {
		function b(a, b) {
			a = a.attr("src").replace(/@.*/, "@1600w_1l_2o");
			var c = [];
			for (i = 0; i < b.length; i++)
			c[i] = b.eq(i).attr("src").replace(/@.*/, "@1600w_1l_2o");
			wx.previewImage({
				current: a,
				urls: c
			})
		}
		0 < a.parents("#ppt_slider").length ? b(a, $("#ppt_slider [data-id] img")) : b(a, $("#speakBubbles .bubble_content img"))
	}

	function sc(a) {
		function b() {
			$(document).on("mousewheel DOMMouseScroll", function(a) {
				0 < $(".img_view_window img").length && (a = a.originalEvent.wheelDelta && (0 < a.originalEvent.wheelDelta ? 1 : -1) || a.originalEvent.detail && (0 < a.originalEvent.detail ? -1 : 1), 0 < a ? l += 100 : 0 > a && (l -= 100), f())
			})
		}

		function c() {
			function a(a) {
				a.preventDefault();
				a.stopPropagation();
				g = Date.now();
				var b = a.originalEvent.target;
				$(document).on("touchend", "#imgViewWin", function(a) {
					a.preventDefault();
					a.stopPropagation();
					$("#imgViewWin").off("touchmove");
					200 > Date.now() - g && ($(".ivwBg")[0] === b || $(".img_view_window .btn_closed")[0] === b) && ($("#imgViewWin img").remove(), $("#imgViewWin").hide())
				})
			}

			function b(a) {
				var b = a.originalEvent.touches[0].pageX - a.originalEvent.touches[1].pageX;
				a = a.originalEvent.touches[0].pageY - a.originalEvent.touches[1].pageY;
				return Math.sqrt(b * b + a * a)
			}

			function c(a) {
				h = b(a);
				$(document).on("touchmove", "#imgViewWin", function(a) {
					k && e(a)
				})
			}

			function e(a) {
				a = b(a);
				l += a - h;
				f();
				h = a;
				$(document).on("touchend", "#imgViewWin", function(a) {
					k = !1;
					h = 0;
					$(document).off("touchmove", "#imgViewWin")
				})
			}
			$(d).css("transition-duration", "0").css("webkit-transition-duration", "0");
			var k = !1,
				h = 0;
			$(document).on("touchstart", "#imgViewWin", function(b) {
				1 === b.originalEvent.touches.length && a(b);
				2 === b.originalEvent.touches.length && (k = !0, c(b))
			});
			var g
		}

		function e() {
			$(document).on("mousedown", ".img_view_window img", function(a) {
				a.preventDefault();
				var b = a.clientX,
					c = a.clientY;
				$(document).on("mousemove", function(a) {
					a.preventDefault();
					var e = a.clientX;
					a = a.clientY;
					$(d).css({
						left: "+=" + (e - b),
						top: "+=" + (a - c)
					});
					b = e;
					c = a
				})
			});
			$(document).mouseup(function() {
				$(this).unbind("mousemove")
			})
		}

		function k() {
			$(document).on("click", "#imgViewWin .ivwBg,.img_view_window .btn_closed", function() {
				$("#imgViewWin img").remove();
				$("#imgViewWin").hide()
			})
		}

		function f() {
			l < m ? l = m : 1600 < l && (l = 1600);
			h = parseInt(l / g);
			d.width = l;
			d.height = h;
			$(d).css("margin-left", -parseInt(l / 2) + "px").css("margin-top", -parseInt(h / 2) + "px")
		}
		var d, l, h, g, m = 100;
		(function(a) {
			d = new Image;
			d.onload = function() {
				l = 500 < d.width ? 500 : d.width;
				m = 100 > d.width ? d.width : 100;
				g = d.width / d.height;
				f();
				$("#imgViewWin").append(d).show()
			};
			a = a.attr("src").replace(/@.*/, "@1600w_1l_2o").replace(/.gif(@.*)/, ".gif");
			d.src = a;
			(r || v) && c();
			e();
			b();
			k()
		})(a)
	}

	function tc(a, b, c) {
		var e = "LIVE";
		if ("PASSWORDGUID" == a || "INVITEGUID" == a || "INSTRUCTIONGUID" == a) e = "TOPIC";
		$.ajax({
			type: "POST",
			url: "/live/saveGuide.htm",
			data: {
				key: a,
				topicId: c || "",
				type: e,
				isEnable: "N",
				liveId: liveId
			},
			success: function(a) {
				"200" == a.statusCode ? ($(".geneBox").hide(), $("." + b).hide()) : $(document).minTipsBox({
					tipsContent: a.msg,
					tipsTime: 1
				})
			},
			error: function() {
				$(document).minTipsBox({
					tipsContent: data.msg,
					tipsTime: 1
				})
			}
		})
	}

	function zb(a) {
		if ($(".barrage_control").hasClass("on") && 1 > $(".danmulist [attr-id=" + a.id + "]").length) {
			var b = "https://img.qlchat.com/qlLive/liveCommon/normalLogo.png";
			/(img\.qlchat\.com)/.test(a.createByHeadImgUrl) ? (b = a.createByHeadImgUrl, b = b.replace(/@.*/, "") + "@64h_64w_1e_1c_2o") : /(wx\.qlogo\.cn\/mmopen)/.test(a.createByHeadImgUrl) && (b = a.createByHeadImgUrl, b = b.replace(/(\/(0|132|64|96)$)/, "/64"));
			b = '<dd attr-id="' + a.id + '" attr-time="' + a.createTime + '"><i><img src="' + b.replace(/(\/(0|132|64|96)$)/, "/64") + '">' + (a.isVip ? '<span class="vip-logo"></span>' : "") + "</i><p>";
			"Y" == a.isQuestion && (b += '<em class="ask_label">问</em>');
			b += wordFilter(a.content) + "</p></dd>";
			0 === $(".danmulist").children().length ? $(".danmulist").append(b) : $(".danmulist dd:last").attr("attr-time") < a.createTime && $(".danmulist").append(b);
			3 < $(".danmulist dd").length && $(".danmulist dd").first().remove()
		}
	}

	function Rb() {
		if (!ib && 0 < bs.length) {
			ib = !0;
			var a = bs.shift(0);
			$(".lmb-item .money").text((a.rewardMoney / 100).toFixed(2));
			$(".lmb-item .head").attr("src", a.speakCreateByHeadImgUrl + "?x-oss-process=image/resize,w_100,h_100,limit_1");
			$(".lmb-item .b-one").text(a.speakCreateByName);
			$(".lmb-item .b-two").text(a.content);
			setTimeout(function() {
				$(".lmb-item").show()
			}, 100);
			setTimeout(function() {
				$(".lmb-item").addClass("on")
			}, 200);
			Sb = 0 < bs.length ? 3500 : 5500;
			setTimeout(function() {
				$(".lmb-item").hide();
				setTimeout(function() {
					$(".lmb-item").removeClass("on")
				}, 50);
				ib = !1;
				Rb()
			}, Sb)
		}
	}

	function uc(a) {
		switch (a.status) {
		case "publish":
			userId == a.userId && (currentUserRole = a.role);
			window.liveTopicInviteJsons.forEach(function(b, c) {
				b.userId == a.userId && ($(".guest_list dd[attr-id=" + a.id + "]").find(".guest_title_2").text(a.title), b.title = a.title || "")
			});
			break;
		case "delete":
			(a.updateTime && a.updateTime.time || a.createTime.time + 6E5) >= currentTimeMillis && (0 < $(".guest_list dd[attr-id=" + a.id + "]").length && $(".guest_list dd[attr-id=" + a.id + "]").remove(), userId == a.userId && (currentUserRole = "", n(), $(".page-body").removeClass("hasTabBottom"), $(".bottom-comment-box").show(), wx.stopRecord({
				complete: function(a) {}
			}), isRecording = !0, G = !1, powerEntity.allowSpeak = !1, $(".qlSpeakTop").css({
				"max-height": "0"
			}), $(".qlSpeakBg").hide(), oa()))
		}
	}

	function qa(a) {
		a = '<dt class="bubble_dt"><b>' + a + "</b></dt>";
		$("#speakBubbles").append(a)
	}

	function nc() {
		PushMessageListener.init({
			dir: "LIVE",
			id: topicId,
			msgType: "public",
			reqSleep: 4E3,
			funcSleep: "0",
			callback: function(a) {
				switch (a.pushExp) {
				case "speak":
					if (0 < $("#speakBubbles").children().length && (a.createTime.time || a.createTime) < Number($("#speakBubbles").children().eq(0).attr("attr-time"))) return !1;
					"beginning" == liveFakeStatus && (y(a, !1), moveToEnd($(".speakContentBox"), !1));
					"redpacket" === a.type && (bs.push(a), Rb());
					break;
				case "comment":
					B(a, !0);
					zb(a);
					0 >= $(".commentBox.isShow").length && !$(".barrage_control").hasClass("on") && $(".barrage_control .tabToComment").addClass("on");
					break;
				case "vote":
					Ab(a);
					break;
				case "speakVote":
					if (0 < $("#speakBubbles [attr-id=" + a.speakId + "]").length) {
						var b = $("#speakBubbles [attr-id=" + a.speakId + "]").find(".liveflower"),
							c = Number(b.text());
						a.id != userId ? b.text(++c) : b.hasClass("on") || (b.addClass("on"), b.text(++c))
					}
					break;
				case "deleteSpeak":
					Cb(a.id);
					break;
				case "deleteComment":
					Eb(a.id);
					break;
				case "liveEnd":
					n();
					$(".page-body").removeClass("hasTabBottom");
					y(a.liveSpeakPo, !1);
					bb = !0;
					break;
				case "prompt":
					y(a.liveSpeakPo, !1);
					moveToEnd($(".speakContentBox"), !1);
					break;
				case "rewardaction":
					Lb(a);
					break;
				case "inviteAdd":
					(a.updateTime && a.updateTime.time || a.createTime.time + 6E5) >= currentTimeMillis && (1 > $(".guest_list dd[attr-id=" + a.id + "]").length && (c = "https://img.qlchat.com/qlLive/liveCommon/normalLogo.png", /^(http)/.test(a.userBackgroundImgUrl) && (c = a.userBackgroundImgUrl), /(img\.qlchat\.com)/.test(c) ? c = c.replace(/@.*/, "") + "@64h_64w_1e_1c_2o" : /(wx\.qlogo\.cn\/mmopen)/.test(c) && (c = c.replace(/(\/(0|132|64|96)$)/, "/64")), b = a.title, c = '<dd attr-id="' + a.id + '" ><span class="guest_img"><img src="' + c + '"></span><span class="guest_title"><var class="guest_title_1">' + a.userName + '</var><var class="guest_title_2">' + b + "</var></span></dd>", $(".guest_list").append(c), qa(b + "" + a.userName + "加入直播间")), userId == a.userId && (currentUserRole = a.role, $(".page-body").hasClass("hasTabBottom") || ($(".page-body").addClass("hasTabBottom"), $(".bottom-comment-box").hide())));
					break;
				case "inviteModify":
					uc(a);
					break;
				case "banned":
					Tb(a.isBanned);
					break;
				case "changeSpeaker":
					a.params ? Gb(a.params) : Gb(a);
					break;
				case "changePPTFile":
					ra(a);
					break;
				case "speakLikes":
					zan.updateZan(a.id, a.likesNum);
					break;
				case "reload":
					a.isEnableReward != percentageRule.isEnable && window.location.reload(!0);
					break;
				case "micReload":
					la();
					break;
				case "barrageFlag":
					Ub(a && a.barrageFlag && "Y" === a.barrageFlag)
				}
			},
			callEver: function() {
				if (!bb) {
					var a = PushMessageListener.onLineNum,
						b = PushMessageListener.commentNum;
					1E4 < a && (a = (a / 1E4).toFixed(1) + "w");
					1E4 < b && (b = (b / 1E4).toFixed(1) + "w");
					0 != a && $(".allcount var").text(a);
					$("#commentNum").text(b)
				}
			}
		})
	}

	function Ka() {
		if (0 < $(".pptMode").length) {
			var a = (9 * $("body").width() / 16).toFixed(0);
			$(".ppt_window").height(a)
		}
	}

	function Xa(a, b, c) {
		switch (a) {
		case "one":
			La && 1 > $("#speakBubbles").children(".left_bubble,.right_bubble").length && 1 > $(".qlTimerShow").length && p();
			break;
		case "two":
			La && (console.log("allLuckyMoneyHandle"), 0 < $("#speakBubbles").children(".left_bubble,.right_bubble,.luckyMoney").length && 10 < b && ("before" == c && 1 > $(".qlTimerShow").length ? (x($("#speakBubbles").children(".left_bubble,.right_bubble,.luckyMoney").eq(0).attr("attr-time")), s = 300) : "after" != c || O || x($("#speakBubbles").children(".left_bubble,.right_bubble,.luckyMoney").last().attr("attr-time"), "", "after")))
		}
	}

	function Tb(a) {
		"N" == a ? (0 < $("#allShutup").length && $("#allShutup").hasClass("swon") ? qa("讨论区现在允许发言") : 1 > $("#allShutup").length && qa("讨论区现在允许发言"), $("#allShutup").removeClass("swon"), $(".caozuo_shutup").removeClass("on"), $(".bottom_content_area").removeClass("disabled"), $(".bottom_content_area .input-box").removeAttr("disabled")) : "Y" == a && (0 < $("#allShutup").length && !$("#allShutup").hasClass("swon") ? qa("讨论区禁言功能已开启") : 1 > $("#allShutup").length && qa("讨论区禁言功能已开启"), $("#allShutup").addClass("swon"), $(".caozuo_shutup").addClass("on"), $(".bottom_content_area").addClass("disabled"), $(".bottom_content_area .input-box").attr("disabled", "disabled"), $(".newCommentBox textarea").attr("placeholder", ""))
	}

	function sa(a, b, c) {
		$(".make_audio_top").html(a);
		$(".audio_make_ul").html(b);
		"Y" == c && $(".make_audio_top").addClass("on");
		$(".makeAudioBox").show()
	}

	function Ub(a) {
		a ? ($(".speakBox").removeClass("hideLkMoney"), La = !1, 0 < $("#btnShowMoney").length && $("#btnShowMoney").addClass("swon")) : (La = !0, $(".speakBox").addClass("hideLkMoney"), 0 < $("#btnShowMoney").length && $("#btnShowMoney").removeClass("swon"))
	}

	function Ua(a) {
		$(".loadingBox").show();
		$("#BubblesTemp").html("");
		$("#speakBubbles").html("");
		m.pause();
		liveFakeStatus = liveStatus;
		$(".qlTimerShow").removeClass("qlTimerShow");
		var b = (new Date).getTime();
		x(b > currentTimeMillis ? b + 864E5 : currentTimeMillis + 864E5, "30", "before", function() {
			$(".loadingBox").hide();
			O = !0;
			moveToEnd($(".speakContentBox"), !0);
			void 0 !== a && "function" === typeof a && a()
		})
	}

	function vc(a) {
		0 < $(".login_box").length ? alertMsg("请登录后使用私问功能") : bv && (bv = !1, $.ajax({
			type: "GET",
			url: "/live/whisper/answerDetail/" + a + ".htm",
			data: {
				questionId: a
			},
			success: function(a) {
				var b = a.qlWhisperQuestionView;
				if ("200" == a.statusCode) {
					b.answerHeadUrl = void 0 !== b.answerHeadUrl ? b.answerHeadUrl : "https://img.qlchat.com/qlLive/liveCommon/normalLogo.png";
					b.questionHeadUrl = void 0 !== b.questionHeadUrl ? b.questionHeadUrl : "https://img.qlchat.com/qlLive/liveCommon/normalLogo.png";
					/(img\.qlchat\.com)/.test(b.answerHeadUrl) ? (b.answerHeadUrl = b.answerHeadUrl, b.answerHeadUrl = b.answerHeadUrl.replace(/@.*/, "") + "@64h_64w_1e_1c_2o") : /(wx\.qlogo\.cn\/mmopen)/.test(b.answerHeadUrl) && (b.answerHeadUrl = b.answerHeadUrl, b.answerHeadUrl = b.answerHeadUrl.replace(/(\/(0|132|64|96)$)/, "/64"));
					/(img\.qlchat\.com)/.test(b.questionHeadUrl) ? (b.questionHeadUrl = b.questionHeadUrl, b.questionHeadUrl = b.questionHeadUrl.replace(/@.*/, "") + "@64h_64w_1e_1c_2o") : /(wx\.qlogo\.cn\/mmopen)/.test(b.questionHeadUrl) && (b.questionHeadUrl = b.questionHeadUrl, b.questionHeadUrl = b.questionHeadUrl.replace(/(\/(0|132|64|96)$)/, "/64"));
					$(".whisperShowBox .qlMT_top var").html(b.questionName);
					$(".wl_msg_item .uesr_quetionName img").attr("src", b.questionHeadUrl);
					$(".wl_msg_item .wl_top_boxFl b").html(b.questionName);
					$(".wl_price var").html(b.money);
					$(".whisper_question").html(b.content + "?");
					$(".listened_total var").html(b.listenNum || "0");
					$(".answer_score").html(b.aveScore || "0");
					$(".wl_msg_item .uesr_answerName img").attr("src", b.answerHeadUrl);
					$(".wl_msg_item .q_date var").html(b.questionTimeView);
					$(".wl_msg_item").attr("attr-id", b.id);
					$(".wl_msg_item").attr("attr-answer", b.answerPerson);
					$(".wl_msg_item").attr("attr-askid", b.questionPerson);
					$(".start_bar")[0].className = "start_bar";
					a = "";
					5 <= b.aveScore ? a = "sc_5" : 4.5 <= b.aveScore ? a = "sc_4_5" : 4 <= b.aveScore ? a = "sc_4" : 3.5 <= b.aveScore ? a = "sc_3_5" : 3 <= b.aveScore ? a = "sc_3" : 2.5 <= b.aveScore ? a = "sc_2_5" : 2 <= b.aveScore ? a = "sc_2" : 1.5 <= b.aveScore ? a = "sc_1_5" : 1 <= b.aveScore && (a = "sc_1");
					$(".start_bar").addClass(a);
					a = "";
					var e = b.qlWhisperAnswerViews,
						k = "1元旁听";
					if ("Y" == b.isFee || b.answerPerson == userId) k = "点击播放";
					for (i = 0; i < e.length; i++)
					a += '<ul class="whisper_answer_wkBox"><li class="uesr_head uesr_answerName"><img src="' + b.answerHeadUrl + '"/></li><li class="wl_answer_boxFl"><div class="audio_box"><i class="ico_audio"></i><p>' + k + '</p><b class="second">' + e[i].second + '"</b><a class="audio_box_play" href="javascript:;"></a></div></li></ul>';
					$(".whisper_answer_ulBox").html(a);
					$(".whisperShowBox").show();
					bv = !0
				} else bv = !0, $(document).minTipsBox({
					tipsContent: a.msg,
					tipsTime: 1
				})
			},
			error: function() {
				bv = !0;
				$(document).minTipsBox({
					tipsContent: data.msg,
					tipsTime: 1
				})
			}
		}))
	}

	function Vb(a) {
		Wb = $("#qlWhisperPlayer");
		ua = a.attr("attr-wsUrl");
		0 < $(".isPlaying").length && $(".isPlaying").click();
		/(\.mp3)/.test(ua) || (ua = ua.replace(/(\.amr)|(\.aac)/gi, "") + gb);
		$(".wl_answer_boxFl .audio_box").removeClass("isWhisperPlay");
		a.parents(".audio_box").addClass("isWhisperPlay");
		N.pause();
		Wb.attr("src", ua);
		setTimeout(function() {
			a.parents(".audio_box").addClass("isWhisperPlay");
			N.play()
		}, 200)
	}

	function wc(a) {
		var b = a.parents(".wl_msg_item").attr("attr-id");
		Ma && (Ma = !1, $.ajax({
			type: "POST",
			url: "/live/whisper/getVoice.htm",
			data: {
				questionId: b
			},
			success: function(b) {
				$(".loadingBox").hide();
				if ("200" == b.statusCode) {
					for (i = 0; i < b.qlWhisperAnswerView.length; i++)
					payForListenItem.find(".audio_box_play").eq(i).attr("attr-wsUrl", b.qlWhisperAnswerView[i].content);
					Vb(a)
				} else $(document).minTipsBox({
					tipsContent: b.msg,
					tipsTime: 1
				});
				Ma = !0
			},
			error: function(a) {
				$(document).minTipsBox({
					tipsContent: a.msg,
					tipsTime: 1
				});
				$(".loadingBox").hide();
				Ma = !0
			}
		}))
	}

	function jb() {
		0 < $(".isWhisperPlay").length && ($(".audio_box").removeClass("isWhisperPlay"), N.pause())
	}

	function xc() {
		wx.chooseImage({
			count: 9,
			sizeType: ["original", "compressed"],
			sourceType: ["album", "camera"],
			success: function(a) {
				bh = a.localIds;
				Ba("pptMode", "N")
			},
			cancel: function(a) {
				$(".loadingBox").hide()
			}
		})
	}

	function Bb(a, b, c, e) {
		var k = [],
			f = {
				status: c,
				topicId: topicId,
				type: "image"
			};
		switch (a) {
		case "mobile":
			f.resourceId = b;
			break;
		case "pc":
			f.url = b
		}
		k.push(f);
		a = {
			id: topicId,
			materialFiles: k
		};
		$(".loadingBox").show();
		$.ajax({
			type: "POST",
			url: "/live/topic/savepptfile.htm",
			data: JSON.stringify(a),
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			async: !1,
			success: function(a) {
				if (200 === a.state.code) {
					Xb(a.data);
					switch (c) {
					case "Y":
						Yb(a.data[0])
					}
					void 0 !== e && "function" === typeof e && e()
				} else alertMsg(a.state.msg);
				$(".loadingBox").hide()
			},
			error: function() {
				var a = result;
				$(".loadingBox").hide();
				alertMsg(a.state.msg)
			}
		})
	}

	function Zb() {
		$("#ppt-select-layer").removeClass("on")
	}

	function yc() {
		function a(a) {
			$(".loadingBox").show();
			$.ajax({
				type: "POST",
				url: "/live/topic/checkfile.htm",
				data: JSON.stringify({
					id: a,
					status: "Y"
				}),
				contentType: "application/json; charset=utf-8",
				dataType: "json",
				async: !1,
				success: function(a) {
					fa = !0;
					if (200 === a.state.code) {
						b.attr("data-status", "Y");
						var c = '<i class="return" data-id="' + e + '">撤回</i>';
						b.parents(".webkitBox").find(".handle-content").append(c);
						Yb(a.data)
					} else alertMsg(a.state.code);
					$(".loadingBox").hide()
				},
				error: function(a) {
					fa = !0;
					$(".loadingBox").hide();
					alertMsg(a.state.code)
				}
			})
		}
		var b = $(this),
			c = b.attr("data-status");
		if ("Y" === c) {
			var e = b.attr("data-id"),
				c = $("#ppt_slider [data-id=" + e + "]").index();
			Zb();
			K.jumpToSlide(c)
		} else "N" === c && (e = b.attr("data-id"), fa && (fa = !1, a(e)))
	}

	function zc() {
		var a = $(this);
		$(".loadingBox").show();
		D("image", a.find("img").attr("src").replace(/@.*/, ""), "", "", function() {
			$(".loadingBox").hide();
			alertMsg("发布成功");
			"Y" != a.data("status") && ($(".loadingBox").show(), $.ajax({
				type: "POST",
				url: "/live/topic/checkfile.htm",
				data: JSON.stringify({
					id: a.data("id"),
					status: "Y"
				}),
				contentType: "application/json; charset=utf-8",
				dataType: "json",
				success: function(b) {
					fa = !0;
					200 === b.state.code ? a.attr("data-status", "Y") : alertMsg(b.state.code);
					$(".loadingBox").hide()
				},
				error: function(a) {
					fa = !0;
					$(".loadingBox").hide();
					alertMsg(a.state.code)
				}
			}))
		})
	}

	function $b(a, b, c, e) {
		$.ajax({
			type: "POST",
			url: "/live/topic/sortfile.htm",
			data: JSON.stringify({
				id: a,
				sortNum: b,
				targetNum: c,
				topicId: topicId
			}),
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			async: !1,
			success: function(a) {
				200 === a.state.code ? void 0 !== e && "function" === typeof e && e() : alertMsg(a.state.msg)
			},
			error: function(a) {
				alertMsg(a.state.msg)
			}
		})
	}

	function ac(a, b) {
		$.ajax({
			type: "POST",
			url: "/live/topic/getpptfiles.htm",
			data: JSON.stringify({
				data: {
					status: a,
					topicId: topicId
				},
				page: {
					page: 1,
					size: 500
				}
			}),
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			async: !1,
			success: function(a) {
				200 === a.state.code ? "function" == typeof b && (a.data ? b(a.data) : b([])) : alertMsg(a.state.msg)
			},
			error: function(a) {
				alertMsg(a.state.msg)
			}
		})
	}

	function Xb(a) {
		a.sort(function(a, b) {
			return a.sortNum - b.sortNum
		});
		for (var b = 0; b < a.length; b++)
		bc(a[b]);
		updateUnsentImgCount();
		$(".loadingBox").hide()
	}

	function bc(a) {
		var b;
		b = a.fileId;
		var c = a.id,
			e = a.sortNum,
			k = a.status,
			f = a.url;
		a = a.type;
		var d = "";
		"Y" === k && $(".pptMode").length && (d = '<i class="return" data-id="' + c + '">撤回</i>');
		b = "image" === a ? '<li class="webkitBox"><div class="boxFlex"><div class="image-content" data-status="' + k + '"data-fileId="' + b + '" data-id="' + c + '" data-sortNum="' + e + '" ><img src="' + f + '@450h_800w_4e_2o_1l_0-0-0bgc" alt=""></div></div><div class="handle-content"><span class="up icon_up"></span><span class="down icon_down"></span><i class="delete icon_trash"></i>' + d + "</div></li>" : void 0;
		bx || $(".ppt-select-list").append(b)
	}

	function Yb(a) {
		ra(a);
		var b = $("#ppt_slider [data-fileid=" + a.fileId + "]").index();
		setTimeout(function() {
			K.jumpToSlide(b)
		}, 100)
	}

	function ra(a) {
		if ((a.checkTimeNum || a.checkTime.time) >= currentTimeMillis) if ("Y" == isrelay && 0 < $(".hasTabBottom").length && 0 >= $("#ppt-select-layer [data-id=" + a.id + "]").length && bc(a), lb) {
			lb = !1;
			if ("Y" == a.status && 1 > $("#ppt_slider [data-id=" + a.id + "]").length) {
				if ($(".speakBox").hasClass("hidePPT") && (Ka(), $(".speakBox").removeClass("hidePPT")), K.addSlide(a.id, a.url, a.fileId), 1 > $(".isPlaying").length) {
					var b = $("#ppt_slider [data-fileid]").last().index();
					setTimeout(function() {
						K.jumpToSlide(b)
					}, 100)
				}
			} else if ("N" == a.status && 0 < $("#ppt_slider [data-id=" + a.id + "]").length) {
				var c = $("#ppt_slider [data-id=" + a.id + "]").index();
				K.removeSlide(c)
			}
			mb(a);
			setTimeout(function() {
				lb = !0
			}, 500)
		} else setTimeout(function() {
			ra(a)
		}, 1E3)
	}

	function mb(a) {
		var b = $("#ppt-select-layer [data-id=" + a.id + "]"),
			c = a.status;
		0 < b.length && b.attr("data-status", c);
		"N" === c ? b.parents(".webkitBox").find(".handle-content .return").remove() : (a = '<i class="return" data-id="' + a.id + '">撤回</i>', b.parents(".webkitBox").find(".handle-content").append(a));
		updateUnsentImgCount()
	}

	function Ac() {
		var a = nb;
		$('#ppt_window [data-id="' + nb + '"]').index();
		by || (by = !0, $(".loadingBox").show(), $.ajax({
			type: "POST",
			url: "/live/topic/checkfile.htm",
			data: JSON.stringify({
				id: a,
				status: "N"
			}),
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			success: function(a) {
				by = !1;
				200 === a.state.code ? (mb(a.data), ra(a.data)) : alertMsg(a.state.code);
				$(".loadingBox").hide()
			},
			error: function(a) {
				by = !1;
				$(".loadingBox").hide();
				alertMsg(a.state.code)
			}
		}))
	}

	function Bc(a) {
		0 < $(".pptMode").length && (K = new Slider(a, "#ppt_window", "@450h_800w_4e_2o_1l_0-0-0bgc", 300, -1, !1), setTimeout(function() {
			if ("ended" == liveStatus && 0 < $("#ppt_window [data-id]").length) K.jumpToSlide(1);
			else if ("ended" != liveStatus && 0 < $("#ppt_window [data-id]").length) {
				var a = $("#ppt_slider [data-fileid]").last().index();
				K.jumpToSlide(a)
			}
			$(".btn_cancel_ppt").click(function() {
				0 < $("#ppt_slider .slide").length && $(document).popBox({
					topContent: "删除素材",
					boxContent: "是否确定撤回图片",
					btnType: "both",
					confirmFunction: Cc
				})
			})
		}, 500))
	}

	function Cc() {
		var a = 0 < $("#ppt_window .active").length ? $("#ppt_window .active") : $("#ppt_window [data-id]").last(),
			b = a.attr("data-id");
		a.index();
		Oa && (Oa = !1, $(".loadingBox").show(), $.ajax({
			type: "POST",
			url: "/live/topic/checkfile.htm",
			data: JSON.stringify({
				id: b,
				status: "N"
			}),
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			success: function(a) {
				Oa = !0;
				200 === a.state.code ? (mb(a.data), ra(a.data)) : alertMsg(a.state.code);
				$(".loadingBox").hide()
			},
			error: function(a) {
				Oa = !0;
				$(".loadingBox").hide();
				alertMsg(a.state.code)
			}
		}))
	}

	function cc(a) {
		w && (w = !1, $(".waitMicBox").hide(), $.ajax({
			type: "POST",
			url: "/live/mic/end.htm",
			data: {
				topicId: topicId
			},
			success: function(b) {
				w = !0;
				200 === b.state.code ? (alertMsg("已结束本轮上麦发言"), va(), $(".left_bubble[attr-id='" + b.data + "']").remove(), "function" == typeof a && a()) : alertMsg(b.state.msg)
			},
			error: function(a) {
				w = !0
			}
		}))
	}

	function $a() {
		0 >= $(".mic-and-typing .mic-btn").length && $(".mic-and-typing").prepend('<a href="javascript:;" class="mic-btn" id="micHandel"><i class="icon_managemic"></i></a>');
		$("#btnAutoPlay").hasClass("swon") && $("#btnAutoPlay").click()
	}

	function va() {
		$("#micHandel").remove();
		powerEntity.allowSpeak || powerEntity.allowMGLive || $("#btnAutoPlay").hasClass("swon") || $("#btnAutoPlay").click()
	}

	function dc() {
		$(".mic-and-typing .mic-btn").removeClass("new")
	}

	function ec(a, b, c) {
		$(document).popBox({
			boxContent: "确定要结束" + b + "用户上麦？",
			btnType: "both",
			confirmFunction: function() {
				$.ajax({
					type: "POST",
					url: "/live/mic/break.htm",
					data: {
						topicId: topicId,
						userId: a
					},
					success: function(a) {
						200 === a.state.code ? "function" == typeof c && c() : alertMsg(a.state.msg)
					},
					error: function(a) {
						alertMsg(a.state.msg)
					}
				})
			}
		})
	}

	function la(a) {
		$.ajax({
			type: "POST",
			url: "/live/mic/list.htm",
			data: {
				topicId: topicId
			},
			success: function(b) {
				if (200 === b.state.code) if (b.data.topicHasMic) $(".waitMicBox").hide(), va(), 0 < $("#waitMicTable.isMicSelf").length && ($("#waitMicTable").removeClass("isMicSelf"), powerEntity.allowSpeak || (ga(), $(document).popBox({
					boxContent: "上麦结束",
					btnType: "cancel",
					cancelName: "我知道了"
				})));
				else {
					var c = b.data.micUserList;
					if (b.data.userHasMic || powerEntity.allowSpeak || powerEntity.allowMGLive) 0 < c.length ? (Dc(c), $(".micListBox").show(), $(".mic-tip").show(), $(".none_record").hide(), (powerEntity.allowSpeak || powerEntity.allowMGLive) && $(".mic-and-typing .mic-btn").addClass("new")) : ($(".none_record").show(), $(".micListBox").hide(), $(".mic-tip").hide(), $("#waitMicTable").html(""), dc()), $a();
					leftMicTime = 3 < b.data.leftMicTime ? Number(b.data.leftMicTime - 3) : 0;
					fc(leftMicTime, c.length);
					c = $("#waitMicTable.isMicSelf").attr("data-status");
					b.data.userHasMic && !powerEntity.allowSpeak && (leftUserMicTime = 3 < b.data.leftUserMicTime ? Number(b.data.leftUserMicTime - 3) : 0, 0 < leftUserMicTime && "get" == c ? (ob(), clearInterval(ha), $(".rec_Title_box").removeClass("isOnMiced"), ha = setInterval(function() {
						leftUserMicTime--;
						0 >= leftUserMicTime && (clearInterval(ha), gc("over"), alertMsg("本次发言已超时"))
					}, 1E3)) : "mic" == c ? (1 > $(".isOnMic").length && $(document).popBox({
						boxContent: "你已被上麦，可继续发言！",
						btnType: "cancel",
						cancelName: "我知道了"
					}), $(".mic-tip").text("发送可直接上墙"), ob(), $(".rec_Title_box.onMic").addClass("isOnMiced"), clearInterval(ha)) : "ready" == c ? (ga(), clearInterval(ha)) : "over" == c || "out" == c || "end" == c ? (0 < $(".isOnMic").length && alertMsg("上麦结束"), $(".waitMicBox").hide(), va(), $(".rec_Title_box").removeClass("isOnMiced"), ga(), $("#waitMicTable").removeClass("isMicSelf")) : clearInterval(ha))
				} else leftMicTime = 3 < b.state.msg ? Number(b.state.msg - 3) : 0, fc(leftMicTime), $(".waitMicBox").hide(), va(), powerEntity.allowSpeak || ga();
				"function" == typeof a && a()
			},
			error: function(a) {}
		})
	}

	function fc(a, b) {
		0 < $(".mic-start .mic-num").length && b && "" != b && (b += $(".mic-start .mic-num").text().replace(/(.*\/)/, "/"), $(".mic-start .mic-num").html(b));
		clearInterval(pb);
		0 >= a ? ($(".mic-start .mic-second").remove(), $(".mic-start .mic-num").remove(), $(".mic-start").addClass("mic-end-new").removeClass("mic-start").find("p").html("本轮抢麦已结束")) : ($(".mic-start .mic-second").html(a), pb = setInterval(function() {
			leftMicTime--;
			a = leftMicTime;
			$(".mic-start .mic-second").html(a);
			0 >= a && (clearInterval(pb), $(".mic-start .mic-second").remove(), $(".mic-start .mic-num").remove(), $(".mic-start").addClass("mic-end-new").removeClass("mic-start").find("p").html("本轮抢麦已结束"))
		}, 1E3))
	}

	function Dc(a) {
		var b = "",
			c, e = "",
			d, f, l = "",
			h = 0;
		$(".giveUpMic").hide();
		for (var g = 0; g <= a.length - 1; g++) {
			f = d = "";
			c = "" != a[g].headImgUrl ? a[g].headImgUrl : "//img.qlchat.com/qlLive/liveCommon/normalLogo.png";
			/(img\.qlchat\.com)/.test(c) ? c = c.replace(/@.*/, "") + "@64h_64w_1e_1c_2o" : /(wx\.qlogo\.cn\/mmopen)/.test(c) && (c = c.replace(/(\/(0|132|64|96)$)/, "/64"));
			listStatus = a[g].status;
			switch (listStatus) {
			case "get":
				e = "上麦准备中";
				l = "get-mic-text2";
				break;
			case "ready":
				e = "等待上麦中";
				h++;
				l = "get-mic-text2";
				if (powerEntity.allowSpeak || powerEntity.allowMGLive) d = '<a class="btn-mic-up">上麦</a>';
				break;
			case "over":
				e = "已超时";
				l = "get-mic-text3";
				break;
			case "end":
				e = "已结束";
				l = "get-mic-text3";
				if (powerEntity.allowSpeak || powerEntity.allowMGLive) d = '<a class="btn-mic-xu">续麦</a>';
				break;
			case "mic":
				e = "正在上麦中";
				l = "get-mic-text4";
				if (powerEntity.allowSpeak || powerEntity.allowMGLive) d = '<a class="btn-mic-over">结束</a>';
				break;
			case "out":
				e = "已离开", l = "get-mic-text3"
			}
			a[g].userId != userId || powerEntity.allowSpeak || (f = "isMicSelf", $("#waitMicTable").attr("data-status", listStatus), $("#waitMicTable").addClass(f), "get" == listStatus || "ready" == listStatus ? ($(".giveUpMic").show(), "ready" == listStatus && $(".mic-tip").html("请等待被选择上麦")) : "mic" == listStatus && $(".mic-tip").html("发送可直接上墙"));
			b += '<tr data-status="' + listStatus + '" data-userid="' + a[g].userId + '" class="list_' + f + '"><td><span class="wait-mic-head"><img src="' + c + '"><i class="wait-mic-num">' + Number(g + 1) + '</i></span></td><td class="get-mic-text1 elli listMicName">' + a[g].userName + '</td><td class="' + l + ' listMicStatus">' + e + "</td><td>" + d + "</td></tr>"
		}
		$("#waitMicTable").html(b);
		$(".wait-list-len").html(h)
	}

	function ob() {
		$a();
		$(".page-body").addClass("hasTabBottom");
		$("#speakBottom").addClass("isOnMic");
		$("#speakBottom .tab_media").hide();
		$("#speakBottom .btn_mLibrary").hide();
		$(".bottom-comment-box").hide()
	}

	function ga() {
		$(".page-body").removeClass("hasTabBottom");
		$("#speakBottom").removeClass("isOnMic");
		$(".bottom-comment-box").show();
		oa();
		wx.stopRecord({})
	}

	function gc(a) {
		$.ajax({
			type: "POST",
			url: "/live/mic/status.htm",
			data: {
				topicId: topicId,
				status: a
			},
			success: function(a) {
				200 === a.state.code ? ($(".getMicBox").hide(), va(), ga()) : alertMsg(a.state.msg)
			},
			error: function(a) {}
		})
	}

	function vb(a, b, c, e, d) {
		if (t) {
			t = !1;
			var f;
			if ("" != c) f = "Y";
			else if (f = "N", "" == b.trim()) return alertMsg("内容不能为空", 1, "bottom"), t = !0, !1;
			if ("text" == a || "mic-text" == a) b = firstFilter(b), b = normalFilter(b);
			if (2E3 < b.trim().length) return alertMsg("内容字数不能超过2000字", 1, "bottom"), t = !0, !1;
			b = JSON.stringify({
				data: {
					liveId: liveId,
					commentId: c,
					topicId: topicId,
					type: a,
					content: b,
					second: e,
					isReplay: f
				}
			});
			c = "";
			var k = $("#waitMicTable.isMicSelf").attr("data-status");
			c = "get" === k ? "/live/mic/ready.htm" : "mic" === k ? "/live/mic/speak.htm" : "/live/mic/answer.htm";
			$(".loadingBox").show();
			$.ajax({
				type: "POST",
				url: c,
				data: b,
				contentType: "application/json; charset=utf-8",
				success: function(b) {
					if ("audio" == a || "audioId" == a || "mic-audio" == a) $(".recordingSending").hide(), Aa = !0, P = "";
					var c = b.data;
					if ("200" == b.state.code) {
						$(".loadingBox").hide();
						if ("text" == a || "mic-text" == a) $(".speakInput").val(""), $(".qlSpeakInput").val("");
						"get" === k && (ga(), $(document).popBox({
							boxContent: "该条消息将在上麦后发出",
							btnType: "cancel",
							cancelName: "我知道了",
							cancelFunction: function() {
								qlSlBoxShow(".waitMicBox")
							}
						}));
						"mic" === k && (y(c.liveSpeakView, !1), moveToEnd($(".speakContentBox"), !0));
						"function" == typeof d && d()
					} else "777" == b.state.code ? ($(".loadingBox").hide(), 0 < $(".recordTemp").length && $(".recordTemp").parents(".left_bubble").remove(), $(document).minTipsBox({
						tipsContent: "微信上传语音异常，请重新录制",
						tipsTime: 1
					})) : ($(".loadingBox").hide(), "405" == b.state.code ? $(document).minTipsBox({
						tipsContent: b.state.msg,
						tipsTime: 5
					}) : $(document).minTipsBox({
						tipsContent: b.state.msg,
						tipsTime: 1
					}), 0 < $(".recordTemp").length && ($(".btn_resend").show(), $(".btn_resend").parents("dd").addClass("err_resend")));
					t = !0
				},
				error: function(a) {
					$(".loadingBox").hide();
					$(document).minTipsBox({
						tipsContent: "发送失败",
						tipsTime: 1
					});
					0 < $(".recordTemp").length && ($(".btn_resend").show(), $(".btn_resend").parents("dd").addClass("err_resend"));
					t = !0
				}
			})
		}
	}
	var r = isiOS(),
		v = isAndroid(),
		Ec = isChrome(),
		O = !1;
	if (r || v) $(".shoucang_btn").parent().show(), $(".backlisten_btn").parent().show();
	v && $("body").addClass("qlAndroid");
	document.getElementById("speakBottom") && document.getElementById("speakBottom").addEventListener("touchmove", function(a) {
		a.preventDefault()
	});
	document.onkeydown = function(a) {
		var b = a || window.event || arguments.callee.caller.arguments[0];
		b && 13 == b.keyCode && (b.ctrlKey || b.commandKey) && $(document.activeElement).hasClass("speakInput") && $(".speakBottom .btnLiveTalk").click()
	};
	r || v || $(".pc_tip").show();
	if (1 != qlsubscribe || !isFollowedThird) {
		var j = "N";
		/.*recommend.*/.test(sessionStorage.getItem("trace_page")) && (j = "Y");
		"Y" != window.isShowQl ? j = "N" : "Y" == window.isShowQl && (j = "Y");
		$.ajax({
			type: "POST",
			url: "/live/getQr.htm",
			data: {
				channel: "202",
				topicId: topicId,
				channelId: channelId,
				showQl: j
			},
			success: function(a) {
				"200" == a.statusCode ? $(".bubble_qrcode").attr("src", a.msg) : $(document).minTipsBox({
					tipsContent: a.msg,
					tipsTime: 1
				})
			},
			error: function() {
				$(document).minTipsBox({
					tipsContent: data.msg,
					tipsTime: 1
				})
			}
		})
	}
	var o = function() {
			function a() {}
			a.prototype.newModal = function(a, c, e, d, f, l, h, g, m) {
				this.fileImage = a;
				this.fileName = c;
				this.fileSize = e;
				this.uploadTime = d;
				this.download = f;
				this.fileCharge = l;
				this.url = h;
				this.hasPay = g;
				this.authView = "true" == g || "0" === l;
				this.docId = m;
				this.render()
			};
			a.prototype.render = function() {
				var a = document.createElement("div");
				a.className = "file-desc";
				a.id = "file-desc";
				this.getTempl();
				a.innerHTML = this.templ;
				this.destroy();
				document.body.appendChild(a);
				this.bindEvent()
			};
			a.prototype.destroy = function() {
				var a = document.querySelector("#file-desc");
				a && document.body.removeChild(a)
			};
			a.prototype.changeState = function() {
				this.hasPay = "true";
				this.url = h(this.docId, this.amount, this.url);
				this.authView = !0;
				this.render()
			};
			a.prototype.getTempl = function() {
				var a = this.authView ? '<span class="confirm">立即查看</span>' : '<span class="confirm">支付￥<b>' + (Number(this.fileCharge) / 100).toFixed(2) + "</b> 立即查看</span>";
				this.templ = ' <div class="bg"></div>\t\n\t<section><span class="icon_cross"></span>\n\t\t<main class="file-desc-main" >\n\t\t\t<span><img src="' + this.fileImage + '" alt=""></span>\n\t\t\t<section>\n\t\t\t\t<h1>' + this.fileName + "</h1>\n\t                    \t\t\t<p>" + convertSize(this.fileSize) + "</p>\n\t                    \t\t</section>\n\t                    \t\t<p>上传时间<span>" + leaveDate(this.uploadTime) + '</span><b><i class="icon_eye_2">' + this.download + "</i>人查看</b></p>\n\t                    \t</main>\n\t                    \t<footer>\n\t                    \t\t" + a + "\n\t                    \t</footer>\n\t                    </section>"
			};
			a.prototype.bindEvent = function() {
				this.bindBgEvent();
				this.authView ? this.bindViewEvent() : this.bindPayEvent()
			};
			a.prototype.bindBgEvent = function(a) {
				var b = this;
				a = document.querySelector("#file-desc .bg");
				var e = document.querySelector("#file-desc .icon_cross");
				a.addEventListener("click", function(a) {
					b.destroy();
					a.stopPropagation()
				});
				e.addEventListener("click", function(a) {
					b.destroy();
					a.stopPropagation()
				})
			};
			a.prototype.bindPayEvent = function() {
				var a = this;
				document.querySelector("#file-desc .confirm").addEventListener("click", function() {
					M = "DOC";
					Ga("DOC", userId, String(a.fileCharge), "", "", "", a.docId)
				})
			};
			a.prototype.bindViewEvent = function() {
				function a() {
					e();
					window.location.href = d.url
				}

				function c() {
					e();
					$(document).popBox({
						topContent: "文件查看",
						boxContent: "查看前需要加载一会儿文件，请耐心等待",
						btnType: "confirm",
						confirmName: "我知道了",
						confirmFunction: function() {
							window.location.href = d.url
						}
					})
				}

				function e() {
					$.ajax({
						type: "POST",
						url: "/doc/api/addOne.htm",
						data: {
							docId: d.docId
						}
					})
				}
				var d = this,
					f = document.querySelector("#file-desc .confirm");
				if (localStorage.getItem("firstUploadFile")) f.addEventListener("click", a);
				else {
					f.addEventListener("click", c);
					try {
						localStorage.setItem("firstUploadFile", "Y")
					} catch (z) {}
				}
			};
			return a
		}(),
		Y, hb;
	(function() {
		function a(a, b, c) {
			/(pptx)|(docx)|(xlsx)/.test(b) && (b = b.slice(0, b.length - 1));
			$(".loadingBox").show();
			a = JSON.stringify({
				data: {
					name: c,
					amount: Number(h),
					download: g,
					topicId: topicId,
					type: b,
					url: a
				}
			});
			$.ajax({
				type: "POST",
				url: "/doc/api/save.htm",
				contentType: "application/json; charset=utf-8",
				dataType: "json",
				async: !1,
				data: a,
				success: function(a) {
					$(".loadingBox").hide();
					200 === a.state.code ? alertMsg("上传成功") : alertMsg(a.state.msg)
				},
				error: function(a) {
					$(".loadingBox").hide();
					alertMsg(a.state.msg)
				}
			})
		}
		var b = $("#upload-file"),
			c = $("#upload-file-box"),
			e = c.find(".confirm"),
			k = $("#file-allow-download"),
			f = $("#upload-file-input"),
			l = $("#upload-file-cancel");
		new o;
		(function() {
			new imgUpload(f, {
				folder: "document",
				onComplete: function(b, c, e) {
					$("#file-progress").hide();
					a(b, c, e)
				},
				onChange: function() {
					c.hide();
					$("#file-progress var").text("0");
					qlSlBoxShow("#file-progress")
				},
				onError: function() {
					$("#file-progress").hide();
					$(".loadingBox").hide()
				},
				uploadType: function() {
					return "doc"
				},
				progress: function(a) {
					$("#file-progress var").text(Math.floor(100 * a))
				}
			})
		})();
		b.click(function() {
			isiOS() ? $(document).popBox({
				boxContent: "使用安卓手机或PC浏览器才可以上传",
				btnType: "confirm",
				confirmName: "我知道了"
			}) : "ended" === liveStatus ? alertMsg("话题结束后不能上传文件") : c.show()
		});
		k.click(function() {
			$(this).toggleClass("swon")
		});
		e.click(function() {
			h = $("#file-charge").val().trim();
			g = "Y";
			isDecimalValid(h, 0, 5E4, "收费金额") && f.find("input").trigger("click")
		});
		l.click(function() {
			$(document).popBox({
				boxContent: "是否确定取消上传",
				btnType: "both",
				confirmFunction: function() {
					$("#file-progress").hide()
				}
			})
		});
		$(document).on("click", ".file-msg", function() {
			var a = $(this).find("section");
			Y = a;
			"true" === a.attr("data-haspay") || "0" === a.attr("data-charge") ? $.ajax({
				type: "POST",
				url: "/doc/api/addOne.htm",
				data: {
					docId: a.attr("data-docid")
				}
			}) : (M = "DOC", Ga("DOC", userId, String(a.attr("data-charge")), "", "", "", a.attr("data-docid")))
		});
		var h, g;
		hb = function() {
			if (!(1 > Y.length)) {
				var a = Y.parents("a"),
					b = Y.attr("data-docid"),
					c = (Number(Y.attr("data-charge")) / 100).toFixed(2),
					e = Y.attr("data-url");
				Y.attr("data-haspay", "true");
				b = d(b, c, e);
				a.attr("href", b);
				a.find("main > p").html("已支付<span>￥" + c + "</span><i>点击下载</i>").addClass("paid")
			}
		}
	})();
	var s = 1,
		ub = !1;
	$(".commentContentBox").scroll(function() {
		!(1 > $(".comment_dd").length) && 1 > $(".commentContentBox .none_record").length && 1 > $(".commentContentBox .box_nothing").length && 2 >= $(".commentContentBox")[0].scrollHeight - $(".commentContentBox")[0].scrollTop - $(".commentContentBox")[0].offsetHeight && ($(".btnLoadComment").addClass("on"), R($(".comment_dd:last-child").attr("attr-time")))
	});
	$(window).resize(function() {
		$("body").animate({
			scrollTop: $("body")[0].scrollHeight
		}, 500);
		0 < $(".pptMode").length && ($(".speakBox").hasClass("hidePPT") || Ka())
	});
	var bd = ["截图后，在输入框粘贴即可发送截图"];
	if (Ec && 0 < $(".speakInput").length && 1 > $(".btn_cancel_on_mic").length) {
		var be;
		setTimeout(function() {
			$(".speakInput").attr("placeholder", bd[0]);
			$(".speakInput").attr("place-cache", bd[0])
		}, 200);
		$(document).on("paste", ".speakInput", function(a) {
			var b = a.originalEvent.clipboardData.types;
			0 < b.length && "Files" === b[0] && (be = a.originalEvent.clipboardData.items[0].getAsFile(), readBlobAsDataURL(be, function(a) {
				$(".image_preview").attr("src", a);
				$(".image_preview").on("load", "", function(a) {
					qlSlBoxShow(".imagePreview")
				})
			}))
		});
		$(document).on("click", ".imagePreview .tlbtn_confirm", function(a) {
			new imgUpload(new File([be], "filename.jpg"), {
				folder: "liveComment",
				onComplete: function(a) {
					D("image", a, "", "", "");
					$(".imagePreview").hide();
					$(".loadingBox").hide()
				},
				onChange: function() {
					$(".loadingBox").show()
				},
				onError: function() {
					$(".loadingBox").hide();
					$(document).minTipsBox({
						tipsContent: "部分图片上传失败，请重新选择",
						tipsTime: 1
					})
				}
			})
		})
	} else "beginning" == liveStatus && powerEntity.allowSpeak && !r && !v && /(http:\/\/m.qlchat.com)/.test(window.location.href) && setTimeout(function() {
		$(document).popBox({
			boxContent: "您当前使用的浏览器兼容性不能达到最佳效果，请使用谷歌Chrome浏览器访问",
			btnType: "confirm"
		})
	}, 3E3);
	if (r) {
		$(document).on("focus", ".speakInput,.bottom_content_area .input-box", function() {
			$("body").animate({
				scrollTop: $("body")[0].scrollHeight
			}, 500)
		});
		var bf = !0;
		$(".speakContentBox")[0].addEventListener("touchstart", function(a) {
			$(".scrollContentBox").append('<div class="scrollEndBox"></div>');
			bf && (bf = !1, 1 > $(".isPlaying").length && (m.play(), m.pause()))
		});
		$(".speakContentBox")[0].addEventListener("touchend", function(a) {
			0 < $(".scrollEndBox").length && $(".scrollEndBox").remove();
			setTimeout(function() {
				1 > $(".scrollEndBox").length && $(".liveBoxContent").append('<div class="scrollEndBox"></div>')
			}, 700)
		})
	}
	if (powerEntity.allowSpeak && 0 < $(".first_record").length) try {
		localStorage.getItem("firstRecord") || ($(".first_record").show(), $("#speakBottom").addClass("has-not-rec"))
	} catch (a) {}
	$(document).on("click", ".first_record", function() {
		$(".first_record").hide();
		try {
			localStorage.setItem("firstRecord", "Y"), $(".first_record").hide()
		} catch (a) {}
	});
	$(document).on("click", ".tab_voice,.micReply", function(a) {
		moveToEnd($(".speakContentBox"), !0);
		var b = $(".mic-replaying").length;
		$("#speakBottom").removeClass("has-not-rec");
		try {
			localStorage.setItem("firstRecord", "Y"), $(".first_record").hide()
		} catch (c) {}
		$(".page-body").hasClass("voiceBottom") ? n() : (n(), $(".page-body").addClass("voiceBottom"));
		0 < b && $(".page-body").addClass("mic-replaying");
		a.stopPropagation()
	});
	$(document).on("click", ".tab_text", function() {
		moveToEnd($(".speakContentBox"), !0);
		0 < $(".mic-replaying").length ? ($(".page-body").addClass("mic-replaying"), $(".speakInput").attr("placeholder", "回复" + $(".page-body .replyMic var").text())) : ($(".page-body").removeClass("mic-replaying"), $(".speakInput").attr("placeholder", $(".speakInput").attr("place-cache")));
		$(".page-body").hasClass("textBottom") ? n(!0) : (n(!0), $(".page-body").addClass("textBottom"), 0 < $(".qlAndroid").length ? $(".ql_input_front").click() : $(".speakInput").focus())
	});
	$(document).on("click", ".micReply", function(a) {
		$(".page-body").addClass("mic-replaying").attr("attr-commentId", $(this).parents("dd").attr("attr-createby"));
		$(".replyMic var").text($(this).parents("dd").find(".speaker_name b").text());
		a.stopPropagation()
	});
	$(".tab_media").click(function() {
		moveToEnd($(".speakContentBox"), !0);
		$(".page-body").hasClass("mediaBottom") ? n() : (n(), $(".page-body").addClass("mediaBottom"))
	});
	$(".backContentBox").click(function() {
		n()
	});
	$("#tab_showQrCode").click(function() {
		moveToEnd($(".speakContentBox"), !0);
		$(".qrcode_areowindow img").attr("src", $(".qrcode_areowindow img").data("src"));
		$("#tab_showQrCode").toggleClass("on");
		$(".qrcode_areowindow").stop().slideToggle()
	});
	$(".ql_input_front").click(function() {
		v && (n(!0), $(".qlSpeakTop").css({
			"max-height": "25rem"
		}), $(".qlSpeakBg").show(), $(".qlSpeakInput").focus())
	});
	$(document).on("click", ".qlSpeakBg,.qlSpeakTop .btnCommentCancel", function() {
		$(".qlSpeakTop").css({
			"max-height": "0"
		});
		$(".qlSpeakBg").hide();
		$(".page-body").addClass("textBottom");
		$(".qlSpeakInput").blur()
	});
	$(".return-to-more").click(function() {
		window.location.href = "/live/" + liveId + ".htm"
	});
	$(".pptToggle").click(function() {
		$(".speakBox").hasClass("hidePPT") ? (Ka(), $(".speakBox").removeClass("hidePPT")) : ($(".speakContentBox").css({
			top: "0px"
		}), $(".speakBox").addClass("hidePPT"))
	});
	var bg = !0;
	$(document).on("click", ".tabToComment, .danmulist dd", function() {
		function a() {
			$(".bottom-comment-box").show();
			$(".bottom-comment-box .btn-tab-control").hide();
			$(".commentBox").show();
			$(".commentBox").addClass("isShow");
			$(".tabToComment").removeClass("on");
			$(".page-body").removeClass("hasTabBottom")
		}
		bg ? R(bt, function() {
			a()
		}) : a()
	});
	$(".commentHeader").click(function() {
		$(".commentBox").hide();
		$(".commentBox").removeClass("isShow");
		$(".bottom-comment-box .btn-tab-control").show();
		if (powerEntity.allowSpeak && "ended" != liveStatus || 0 < $(".isOnMic").length) $(".bottom-comment-box").hide(), $(".page-body").addClass("hasTabBottom")
	});
	$(".tabTopMenu").click(function() {
		$(".top_menu").toggle()
	});
	$(document).on("click", ".tabToLiveIndex", function(a) {
		window.location.href = "/live/" + liveId + ".htm"
	});
	var t = !0;
	$(".speakBottom .btnLiveTalk").click(function(a) {
		a.preventDefault();
		q("text", $(".speakInput").val(), "", "", "")
	});
	$(".qlSpeakTop .btnLiveTalk").click(function(a) {
		a.preventDefault();
		q("text", $(".qlSpeakInput").val(), "", "", "")
	});
	$(document).on("click", ".close_tips", function() {
		$(".top_follow_tips").remove();
		rememberCloseTipsList(topicId)
	});
	$(document).on("click", ".newCommentBox .submit", function(a) {
		if (0 < $(".caozuo_shutup.on").length) return alertMsg("直播间开启了禁言模式"), !1;
		if (0 < $(".bottom_content_area.disabled").length) return alertMsg("您已被禁言"), !1;
		a = "N";
		$(".newCommentBox .btn_ask").hasClass("on") && (a = "Y");
		var b = $(this).parents(".bottom_content_area").find(".input-box").val().trim();
		ja("text", b, a)
	});
	$(".bottom_content_area .btn_ask").click(function() {
		$(this).toggleClass("on")
	});
	$(".bottom_content_area .input-box").focus(function() {
		$(this).css("max-height", "75px")
	}).blur(function() {
		$(this).css("max-height", "35px")
	});
	var Q = !0,
		wb = "30",
		yb = !1,
		Ya = !1,
		ka = !0,
		ab, U, bb = !1,
		Wa = 1E3;
	$(document).on("click", ".btn_wall", function() {
		$(this).parents(".comment_dd").find(".author_name").text();
		$(".commentReplyBox").attr("attrCommentId", $(this).parents(".comment_dd").attr("attr-id"));
		$(".commentReplyBox textarea").val("");
		$(".commentReplyBox").show()
	}).on("click", ".btn_like,.btn_hate", function() {
		var a, b = $(this).parents(".comment_dd").attr("attr-id"),
			c = "liked",
			e = "hated",
			d = $(this);
		$(this).hasClass("btn_like") ? a = "likes" : $(this).hasClass("btn_hate") && (a = "despise", c = "hated", e = "liked");
		$(this).parents(".comment_dd").hasClass(c) || ($(this).parents(".comment_dd").addClass(c), $.ajax({
			type: "POST",
			url: "/live/comment/commentLike.htm",
			data: {
				liveId: liveId,
				topicId: topicId,
				voteType: a,
				commentId: b
			},
			success: function(a) {
				"200" == a.statusCode ? (d.parents(".comment_dd").removeClass(e), a = '{"id":"' + a.result.id + '","commentId":"' + a.result.commentId + '","voteType":"' + a.result.voteType + '","liveCommentPo":{"despiseNum":"' + a.result.liveCommentPo.despiseNum + '","likesNum":"' + a.result.liveCommentPo.likesNum + '"}}', a = eval("(" + a + ")"), Ab(a)) : "205" == a.statusCode && $(document).minTipsBox({
					tipsContent: a.msg,
					tipsTime: 1
				})
			},
			error: function() {
				d.parents(".comment_dd").removeClass(c)
			}
		}))
	});
	$(".commentReplyBox .gene_confirm").click(function(a) {
		D("text", $(".commentReplyBox textarea").val(), $(".commentReplyBox").attr("attrCommentId"), "", "");
		a.preventDefault()
	});
	if (r || v) {
		var bh;
		$(".btnImgUpload").click(function() {
			wx.chooseImage({
				count: 9,
				sizeType: ["original", "compressed"],
				sourceType: ["album", "camera"],
				success: function(a) {
					bh = a.localIds;
					Ba("normal")
				},
				cancel: function(a) {
					$(".loadingBox").hide()
				}
			})
		})
	} else 0 < $(".btnImgUpload").length && new imgUpload($(".btnImgUpload"), {
		folder: "liveComment",
		onComplete: function(a) {
			D("image", a, "", "", "");
			$(".loadingBox").hide()
		},
		onChange: function() {
			$(".loadingBox").show()
		},
		onError: function() {
			$(".loadingBox").hide()
		}
	});
	$(document).on("click", ".btn_revoke", function(a) {
		a.stopPropagation();
		a = $(this);
		speakId = $(this).parents("dd").attr("attr-id");
		createBy = $(this).parents("dd").attr("attr-createby");
		createName = $(this).parents("dd").find(".speaker_name b").html();
		"true" == a.attr("onMicSpeak") && "Y" != isrelay ? $(document).popBox({
			boxContent: "确定撤回" + createName + "的消息吗？",
			btnType: "both",
			confirmName: "仅撤回消息",
			cancelName: "撤回并禁言",
			confirmFunction: function() {
				cb(speakId, createBy)
			},
			cancelFunction: function() {
				Fb(createBy, function() {
					cb(speakId, createBy)
				})
			}
		}) : $(document).popBox({
			boxContent: "确定撤回吗？",
			btnType: "both",
			confirmFunction: function() {
				cb(speakId, createBy)
			}
		})
	});
	$(document).on("click", ".delCommentMsg", function() {
		$(this);
		commentId = $(this).parents("dd").attr("attr-id");
		createBy = $(this).parents("dd").attr("attr-createby");
		$(document).popBox({
			boxContent: "确定删除吗？",
			btnType: "both",
			confirmFunction: function() {
				Db(commentId, createBy)
			}
		})
	});
	var bi, db = !0,
		A = 0,
		J, kc, Pa, xa = !0,
		G = !1,
		Aa = !0,
		S = xa = !0,
		lc = !0,
		rb = !0;
	document.getElementById("speakBottom") && (Pa = document.getElementById("speakBottom").offsetTop + $(".tab_speak")[0].offsetHeight);
	var bj = !0;
	wx.ready(function() {
		wx.onVoicePlayEnd({
			success: function(a) {
				0 < $(".isOnMic").length && 0 < $("#btnCheckRec").length && $("#btnCheckRec").text("试听").removeClass("btn_pause")
			}
		});
		wx.onVoiceRecordEnd({
			complete: function(a) {
				58 > A && 1 > $(".changeRecType").length && r ? (clearInterval(J), I(), ma(myName, "N"), $(".recording_click .btn_dd").addClass("stopRec"), $(".rTips_1").hide(), $(".rTips_2").hide(), $(".rTips_5").show(), $(document).popBox({
					boxContent: "微信自动结束录音，是否发送录音",
					btnType: "both",
					confirmFunction: function() {
						eb(a.localId)
					},
					cancelFunction: function() {
						oa()
					}
				})) : eb(a.localId)
			}
		})
	});
	if ((r || v) && 0 < $("#speakBottom").length) {
		$("#save_button").remove();
		$(".details").remove();
		$("#uploadForm").remove();
		document.getElementById("btnRecording").addEventListener("touchstart", function(a) {
			a.preventDefault();
			lc && (lc = !1, $(document).minTipsBox({
				tipsContent: "如果遇到无法录音，请切换录音模式",
				tipsTime: 3
			}));
			Pa = document.getElementById("speakBottom").offsetTop + $(".tab_speak")[0].offsetHeight;
			xa = !0;
			isRecording && Aa && S && rb && (rb = isRecording = !1, setTimeout(function() {
				rb = !0
			}, 1E3), clearTimeout(kc), wx.startRecord({
				success: function(a) {
					V();
					m.pause();
					E && (E = !1, $("#btnAutoPlay").removeClass("swon"));
					xa ? (G = !0, $("#btnRecording").addClass("on"), $(".speakBottom").addClass("recording"), $(".rTips_3").show(), $(".recing_bg").show(), A = 0, J = setInterval(Ib, 980)) : wx.stopRecord({
						complete: function(a) {
							isRecording = !0
						}
					})
				},
				fail: function(a) {
					isRecording = !0
				}
			}))
		});
		document.getElementById("btnRecording").addEventListener("touchmove", function(a) {
			0 < $(".changeRecType").length && (a.changedTouches[0].clientY >= Pa ? ($(".rTips_4").hide(), $(".rTips_3").show()) : ($(".rTips_4").show(), $(".rTips_3").hide()))
		});
		document.getElementById("btnRecording").addEventListener("touchend", function(a) {
			if (0 < $(".changeRecType").length) {
				xa = !1;
				$(".speakBottom").removeClass("recording");
				$(".recordingTips").hide();
				$(".recing_bg").hide();
				$("#btnRecording").removeClass("on");
				$(".second_dd var").text("0");
				if (G) {
					var b, c = a.changedTouches[0].clientY;
					clearInterval(J);
					1 > A ? ($(document).minTipsBox({
						tipsContent: "录音时间太短",
						tipsTime: 1
					}), wx.stopRecord({
						complete: function(a) {}
					}), isRecording = !0, G = !1) : wx.stopRecord({
						success: function(a) {
							b = a.localId;
							ma(myName, "N");
							c >= Pa ? Ea(b) : $(document).minTipsBox({
								tipsContent: "已取消发送",
								tipsTime: 1
							})
						},
						complete: function(a) {
							isRecording = !0;
							G = !1
						}
					})
				} else wx.stopRecord(), isRecording = !0;
				kc = setTimeout(function() {
					xa || (wx.startRecord({
						complete: function(a) {
							wx.stopRecord({
								complete: function(a) {}
							})
						}
					}), isRecording = !0, G = !1, clearInterval(J), $(".second_dd var").text("0"))
				}, 500)
			}
		});
		$(".recType_1").click(function() {
			$(".recording_tab_box").removeClass("changeRecType")
		});
		$(".recType_2").click(function() {
			$(".recording_tab_box").addClass("changeRecType")
		});
		$("#btnStartRec").click(function() {
			if (r || v) try {
				noSleep.enable()
			} catch (a) {}
			S && (S = !1, G = !0, wx.startRecord({
				success: function(a) {
					V();
					m.pause();
					E && (E = !1, $("#btnAutoPlay").removeClass("swon"));
					I();
					$(".recording_click .btn_dd").addClass("startRec");
					$(".speakBottom").addClass("recording");
					$(".rTips_1").show();
					$(".recing_bg").show();
					A = 0;
					J = setInterval(Ib, 980);
					W(!1)
				},
				fail: function(a) {
					S = !0;
					I();
					W(!0)
				}
			}))
		});
		var P;
		$("#btnStopRec").click(function() {
			G = !1;
			1 > A ? $(document).minTipsBox({
				tipsContent: "录音时间太短",
				tipsTime: 1
			}) : (clearInterval(J), wx.stopRecord({
				success: function(a) {
					P = a.localId;
					I();
					ma(myName, "N");
					$(".recording_click .btn_dd").addClass("stopRec");
					$(".rTips_1").hide();
					$(".rTips_2").hide();
					$(".rTips_5").show()
				},
				fail: function(a) {
					I();
					S = !0;
					$(".second_dd var").text("0");
					$(".speakBottom").removeClass("recording");
					$(".recordingTips").hide();
					$(document).minTipsBox({
						tipsContent: a.errMsg,
						tipsTime: 1
					})
				},
				complete: function() {}
			}))
		});
		var bk = !0;
		$("#btnSentRec").click(function() {
			bk && "" != P && (bk = !1, setTimeout(function() {
				bk = !0
			}, 2E3), Ea(P))
		});
		$(document).on("click", "#btnCheckRec", function() {
			"试听" == $(this).text() ? (wx.playVoice({
				localId: P
			}), E = !1, $("#btnAutoPlay").removeClass("swon"), $(this).text("暂停").addClass("btn_pause")) : ($(this).text("试听").removeClass("btn_pause"), E = !0, $("#btnAutoPlay").addClass("swon"), wx.stopVoice({
				localId: P
			}))
		});
		$(document).on("click", "#btnCancelRec,#btnAgainRec,.recing_bg", function() {
			$(document).popBox({
				boxContent: "取消当条声音录制？",
				btnType: "both",
				confirmFunction: function() {
					oa()
				}
			})
		});
		$(document).on("click", ".btn_resend", function() {
			$(this).hide();
			var a, b = $(this).parents(".left_bubble").find("var").text();
			$(this).parents(".left_bubble").attr("qlWxSevId") ? (a = $(this).parents(".left_bubble").attr("qlWxSevId"), D("audioId", a, "", b, "")) : (a = $(this).parents(".left_bubble").attr("qlWxLoaclId"), bj = !0, 0 != $(".btn_resend").index($(this)) && ($(".btn_resend").show(), $(".btn_resend").parents("dd").addClass("err_resend")), Ea(a))
		})
	} else!r && !v && 0 < $("#speakBottom").length ? ($(".rTips_1").text("录满60秒将自动发送"), $(".recType_2").hide(), 0 < $("#audioUploadBox").length && $("#audioUploadBox").click(function() {
		$(".loadingBox").show();
		new imgUpload($("#audioUploadBox"), {
			folder: "audio",
			onComplete: function(a) {
				W(!0);
				q("pcAudioUrl", a, "", $(".second_dd var").text(), function() {
					$(".loadingBox").hide()
				});
				$(".speakBottom").removeClass("recording");
				I();
				$(".recordingTips").hide();
				$(".recing_bg").hide();
				$(".second_dd var").text("0")
			},
			onChange: function() {},
			onError: function() {
				W(!0);
				$(".loadingBox").hide()
			},
			uploadType: function() {
				return "mp3"
			}
		}, audioObj)
	}), $("#btnStartRec").click(function() {
		0 < $("#waitMicTable.isMicSelf").length ? $(document).minTipsBox({
			tipsContent: "请到手机端录音发言",
			tipsTime: 1
		}) : (configureMicrophone(), FWRecorder.observeLevel(), FWRecorder.record("audio", "audio.wav"))
	}), $("#btnStopRec").click(function() {
		1 > Number($(".second_dd var").text()) ? $(document).minTipsBox({
			tipsContent: "录音时间太短",
			tipsTime: 1
		}) : (FWRecorder.stopObservingLevel(), FWRecorder.stopRecording("audio"))
	}), $("#btnSentRec").click(function() {
		audioObj = new File([FWRecorder.getBlob("audio")], "pcRec.wav");
		$("#audioUploadBox").click()
	}), $(document).on("click", "#btnCancelRec,.recing_bg", function() {
		$(document).popBox({
			boxContent: "取消当条声音录制？",
			btnType: "both",
			confirmFunction: function() {
				W(!0);
				FWRecorder.stopObservingLevel();
				FWRecorder.stopRecording("audio");
				$(".second_dd var").text("0");
				$(".speakBottom").removeClass("recording");
				$(".recordingTips").hide();
				$(".recing_bg").hide();
				I();
				clearInterval(J)
			}
		})
	})) : ($("#save_button").remove(), $(".details").remove(), $("#uploadForm").remove());
	var bl = document.createElement("audio");
	bl.setAttribute("class", "gat");
	bl.setAttribute("preload", "auto");
	bl.volume = 0;
	document.body.appendChild(bl);
	var E = !0,
		m = document.getElementById("audioPlayer"),
		F = $("#audioPlayer"),
		gb = ".aac",
		mc = 0,
		Qa = 0,
		Da = !1;
	isAndroid() && (gb = ".amr");
	var bm = "";
	$(document).on("click", ".recordingMsg", function(a) {
		if ("icon_checked" == a.target.className) return !1;
		ca($(this), "click")
	});
	var X, g, fb = !0,
		Fa = 0,
		Kb = !1;
	m.loop = !1;
	try {
		m.addEventListener("ended", function() {
			var a = $(".isPlaying");
			a.removeClass("audioloading");
			clearInterval(X);
			a = $("#speakBubbles .recordingMsg").index(a); - 1 != a && a < $("#speakBubbles .recordingMsg").length - 1 ? ca($("#speakBubbles .recordingMsg").eq(a + 1), "loop") : V();
			showBtnToPlayingItem()
		}, !1), setTimeout(function() {
			m.addEventListener("pause", function() {
				F.hasClass("isSpecialPause") || ($(".isPlaying"), clearInterval(X))
			}, !1)
		}, 1E3), m.addEventListener("canplaythrough", function(a) {
			$(".isPlaying").removeClass("audioloading");
			X && clearInterval(X);
			X = setInterval(function() {
				F.removeClass("isSpecialPause");
				mc == m.currentTime ? ($(".isPlaying").addClass("audioloading"), Qa++, 2 < Qa && r && (Qa = 0, F.addClass("isSpecialPause"), m.pause(), m.currentTime = Number((m.currentTime + .1).toFixed(3)), m.play())) : (Qa = 0, $(".isPlaying").removeClass("audioloading"));
				mc = m.currentTime
			}, 1100)
		}, !1), m.addEventListener("stalled", function(a) {
			console.log("stalled")
		}, !1), m.addEventListener("error", function(a) {
			var b, c = m.error.code;
			switch (c) {
			case 1:
				b = "1: MEDIA_ERR_ABORTED - 取回过程被用户中止";
				break;
			case 2:
				b = "2: MEDIA_ERR_NETWORK - 当下载时发生错误";
				break;
			case 3:
				b = "3: MEDIA_ERR_DECODE - 当解码时发生错误";
				break;
			case 4:
				b = "4: MEDIA_ERR_SRC_NOT_SUPPORTED - 不支持音频/视频"
			}
			console.log("error : " + b);
			Da || (/(https\:)/.test(g) && /(amr|aac)/.test(g) ? (g = g.replace("https:", "http:"), F.attr("src", g), m.play()) : /(http\:)/.test(g) && /(amr|aac)/.test(g) ? (g = g.replace("http:", "https:"), g = g.replace("media.qlchat.com", "audio.qianliaowang.com").replace(/\.(amr|aac)/, ".mp3"), F.attr("src", g), m.play()) : /(https\:)/.test(g) && /(\.mp3)/.test(g) ? (g = g.replace("https:", "http:"), F.attr("src", g), m.play()) : /(again)/.test(g) ? ($(document).minTipsBox({
				tipsContent: "音频加载失败，请稍后重试",
				tipsTime: 1
			}), V(), qc(a, b, c)) : (g = g + "?again=" + (new Date).getTime(), F.attr("src", g), m.play()), console.log(g))
		}, !1), m.addEventListener("suspend", function() {
			console.log("suspend")
		}, !1), m.addEventListener("abort", function() {
			showBtnToPlayingItem();
			console.log("abort")
		}, !1), m.addEventListener("play", function() {
			showBtnToPlayingItem();
			console.log("play")
		}), m.addEventListener("pause", function() {
			showBtnToPlayingItem();
			console.log("play")
		})
	} catch (a) {
		_qla && _qla("error", {
			message: JSON.stringify(a),
			type: "audioAddEventListenerFail"
		})
	}
	var bn = {};
	localStorage.getItem("recordReaded") && (bn = JSON.parse(localStorage.recordReaded));
	$("#speakBubbles .recordingMsg").each(function() {
		xb($(this).parents("dd").attr("attr-id"))
	});
	localStorage.getItem("isAutoPlay") && "false" == localStorage.getItem("isAutoPlay") && (E = !1);
	powerEntity.allowSpeak && (E = !1);
	E || $("#btnAutoPlay").removeClass("swon");
	$(document).on("click", "#btnAutoPlay", function() {
		$("#btnAutoPlay").toggleClass("swon");
		$("#btnAutoPlay").hasClass("swon") ? (E = !0, localStorage.setItem("isAutoPlay", "true")) : (E = !1, localStorage.setItem("isAutoPlay", "false"))
	});
	var bo;
	0 < $("#btnUploadMP3").length && (isiOS() ? $("#btnUploadMP3").click(function() {
		$(document).popBox({
			boxContent: "使用安卓手机或PC浏览器才可以上传",
			btnType: "confirm",
			confirmName: "我知道了"
		})
	}) : (localStorage.getItem("hasUploadAudio") ? Mb() : ($("#btnUploadMP3").click(function() {
		qlSlBoxShow(".uploadAudioTips");
		Mb();
		$("#btnUploadMP3").unbind()
	}), $(".uploadAudioTips .tlbtn_confirm").click(function() {
		$(".uploadAudioTips").hide();
		localStorage.setItem("hasUploadAudio", "Y");
		$("#btnUploadMP3 input").click()
	})), $(".audioProgress .tlbtn_confirm").click(function() {
		$(document).popBox({
			boxContent: "是否确定取消上传",
			btnType: "both",
			confirmFunction: function() {
				bo._settings.isCancelSend = !0
			}
		})
	})));
	$(document).on("click", ".play_video", function() {
		var a = $(this).siblings("iframe"),
			b = $(this).parents("dd").attr("attr-id");
		$("#videoIframe").attr({
			src: a.attr("src") + "=?isAutoPlay=true",
			"attr-id": b
		});
		qlSlBoxShow(".videoPreview")
	}).on("click", ".videoPreview .btn_closed", function() {
		$("#videoIframe").attr({
			src: "",
			"attr-id": ""
		});
		$(".videoPreview").hide()
	});
	$(".btnInsertVideo").click(function() {
		qlSlBoxShow(".insertVideo")
	});
	$(".insertVideo .tlbtn_confirm").click(function() {
		var a = $(".insertVideoText").val();
		/^(\<iframe ).*((v\.qq\.com)|(player\.youku\.com)).*(\>\<\/iframe\>)$/.test(a.trim()) ? D("text", a, "", "", function() {
			$(".insertVideo").hide();
			$(".insertVideoText").val("")
		}) : alertMsg("只支持腾讯优酷视频ifram通用代码发送")
	});
	$(document).on("click", ".btn_ilike", function() {
		var a = $(this).parents("dd").attr("attr-createby"),
			b = $(this).parents("dd").find(".speaker_name b").text(),
			c = $(this).parents("dd").find(".head_portrait img").attr("src");
		$(".live_headpic img").attr("src", c);
		$(".live_towho").attr("shangid", a);
		$(".live_towho").text(b);
		a = $(".live_redbaglist ul").data("price").split(";");
		for (i = 0; i < a.length; i++)
		$(".live_redbaglist var.rglist").eq(i).text(a[i]);
		qlSlBoxShow(".redbagBox")
	});
	var bp = !0;
	$(document).on("click", ".live_redbaglist li", function() {
		var a = $(".live_towho").attr("shangid");
		if (a == userId) return alertMsg("自己不能赞赏自己"), !1;
		var b = Number($(this).find("var").text());
		if (!(2 > Number(b)) && 1E3 < Number(b)) return $(document).minTipsBox({
			tipsContent: "请输入小于1000的金额",
			tipsTime: 1
		}), !1;
		Ob(100 * b, a, liveId, topicId)
	});
	$(document).on("click", ".live_othermoney", function() {
		$(".otherRedmoneyBox").show()
	}).on("click", ".otherRedmoneyBox", function(a) {
		if ("redbag_count_label" == a.target.className || "money_count" == a.target.className || "gene_btn gene_confirm" == a.target.className) return !1;
		$(".otherRedmoneyBox").hide()
	});
	$(document).on("click", ".otherRedmoneyBox .gene_confirm", function() {
		var a = Number($(".money_count").val()),
			b = $(".live_towho").attr("shangid");
		if (b == userId) return alertMsg("自己不能赞赏自己"), !1;
		if ("" == a) return $(document).minTipsBox({
			tipsContent: "金额不能为空",
			tipsTime: 1
		}), !1;
		if (/(^[0-9]*\.[0-9]*$)|(^[0-9]*$)/.test(a)) {
			if (2 > Number(a)) return $(document).minTipsBox({
				tipsContent: "请输入大于2的金额",
				tipsTime: 1
			}), !1;
			if (1E3 < Number(a)) return $(document).minTipsBox({
				tipsContent: "请输入小于1000的金额",
				tipsTime: 1
			}), !1
		} else return $(document).minTipsBox({
			tipsContent: "请输入数字!",
			tipsTime: 1
		}), !1;
		a = (100 * a).toFixed(0);
		Ob(a, b, liveId, topicId);
		$(".otherRedmoneyBox").hide()
	});
	var M, Ia = "";
	$(document).on("click", ".payQrBox", function(a) {
		"payQrPic" != a.target.className && ($(this).hide(), clearTimeout(Ia))
	});
	var bq = "",
		Ra = "",
		Z = "",
		Sa = !0;
	$(document).on("click", ".luckyMoney .lm_main", function() {
		$(".LmTipsBox").attr("attr-id", $(this).parent().attr("attr-id"));
		$(".live_headpic img").attr("src", $(this).attr("attr-imgUrl"));
		$(".thank_money var").text(Number($(this).attr("attr-money")) / 100);
		Z = $(this).attr("attr-response");
		bq = $(this).find("var").eq(0).text();
		Ra = $(this).find("var").eq(1).text();
		$(".replyresult .r1").text(Ra);
		$(".replyresult .r2").text(bq);
		$(".LmTipsBox .live_towhy").text(bq + "赞赏了" + Ra);
		"" != Z && "null" != Z && "undefined" != Z ? ("baobao" == Z ? $(".replyresult .r3").text("拥抱") : "loveyou" == Z ? $(".replyresult .r3").text("握手") : "meme" == Z && $(".replyresult .r3").text("么么哒"), $(".replyresult").addClass("on").show(), $(".thankBox").removeClass("on").hide()) : ($(".replyresult").removeClass("on").hide(), "true" == $(this).attr("attr-myself") ? ($(".LmTipsBox .live_towhy").text(bq + "赞赏了你"), $(".thankBox").addClass("on").show(), $(".rgdetail").show()) : $(".replyresultNone").addClass("on").show());
		if (powerEntity.allowMGLive || "true" == $(this).attr("attr-myself")) $(".rgdetail").show(), $(".redbag_rule_2").show(), "true" == $(this).attr("attr-myself") && ($(".redbag_rule_2").hide(), $(".redbag_rule_3").show());
		$(".thank_money").show();
		"" != $(this).attr("attr-money") && "null" != $(this).attr("attr-money") && void 0 != $(this).attr("attr-money") || $(".thank_money").hide();
		qlSlBoxShow(".LmTipsBox")
	}).on("click", ".thank_choose dd", function() {
		var a = $(this).attr("attr-action"),
			b = $(this);
		$.ajax({
			type: "POST",
			url: "/live/speak/addAction.htm",
			data: {
				topicId: topicId,
				speakId: $(".LmTipsBox").attr("attr-id"),
				action: a
			},
			success: function(a) {
				"200" == a.statusCode ? (Lb(a.liveSpeakView), $(".replyresult").addClass("on").show(), $(".thankBox").removeClass("on").hide(), $(".replyresult .r1").text(Ra), $(".replyresult .r2").text(bq), $(".replyresult .r3").text(b.html())) : $(document).minTipsBox({
					tipsContent: a.msg,
					tipsTime: 1
				})
			},
			error: function(a) {
				$(document).minTipsBox({
					tipsContent: a.msg,
					tipsTime: 1
				})
			}
		})
	}).on("click", ".rgdetail .rglist", function() {
		Sa ? (Sa = !1, $(this).parent(".rgdetail").addClass("on"), $(".replyresultNone.on").hide(), $(".replyresult.on").hide(), $(".thankBox.on").hide()) : (Sa = !0, $(this).parent(".rgdetail").removeClass("on"), $(".replyresultNone.on").show(), $(".replyresult.on").show(), $(".thankBox.on").show());
		$(".managerThankBox").slideToggle()
	});
	$(document).on("click", ".LmTipsBox", function(a) {
		if (/(rglist)/.test(a.target.className)) return !1;
		$(this).hide();
		$(".managerThankBox").hide();
		$(".rgdetail").hide();
		$(".replyresultNone").removeClass("on").hide();
		$(".redbag_rule_3").hide();
		Sa = !0;
		$(".rgdetail").removeClass("on")
	});
	$(document).on("click", ".redbagBox", function(a) {
		if ("rglist" == a.target.className) return !1;
		$(this).hide()
	});
	$(document).on("click", "#speakBubbles .bubble_content img,#ppt_slider img", function() {
		var a = !/.gif(@*)/.test($(this).attr("src")),
			b = r || v,
			c = $(this);
		a && b ? rc(c) : sc(c)
	});
	$("#loginbtn").click(function() {
		var a = window.location.href,
			a = -1 == a.indexOf("?") ? a + "?" : a + "&";
		$.ajax({
			type: "POST",
			url: "/ifLogIn.htm",
			headers: {
				"Static-Referer": a + "preview=Y&intoPreview=Y"
			}
		})
	});
	$(document).on("click", ".btn_closeCBox,.caozuo_box .cbBg,.caozuo_cancel_btn", function() {
		$(".caozuo_box").removeClass("on");
		$(".speakContentBox").css("overflow", "auto");
		$(".collecttips").hide();
		$(".caozuo_box .czbox_main").animate({
			maxHeight: "0"
		}, 300)
	});
	$(".controlBox").click(function() {
		$(".caozuo_box").addClass("on");
		$(".speakContentBox").css("overflow", "hidden");
		$(".caozuo_box .czbox_main").animate({
			maxHeight: "45rem"
		}, 300)
	});
	$(document).on("click", ".btn_finish_live", function() {
		$(".finishBox").show()
	});
	$(document).on("click", ".finishBox .gene_confirm", function() {
		$.ajax({
			type: "POST",
			url: "/live/topic/topicMg.htm",
			data: {
				topicId: topicId,
				type: "endTopic"
			},
			success: function(a) {
				$(".loadingBox").hide();
				"200" == a.statusCode && window.location.reload(!0);
				$(document).minTipsBox({
					tipsContent: a.msg,
					tipsTime: 1
				})
			},
			error: function(a) {
				$(document).minTipsBox({
					tipsContent: a.msg,
					tipsTime: 1
				});
				$(".loadingBox").hide()
			}
		})
	});
	$(document).on("click", ".setPasswordTips .gtb_close", function() {
		tc("PASSWORDGUID", "setPasswordTips", topicId)
	});
	$(document).on("click", ".btnCloseTopicTips", function() {
		$(".topicTipsDl").hide()
	});
	var br = !1;
	$(document).on("click", ".allcount.btn-mgr-commnet", function() {
		if (0 < $(".caozuo_shutup.on").length) return alertMsg("直播间开启了禁言模式"), !1;
		if (0 < $(".bottom_content_area.disabled").length) return alertMsg("您已被禁言"), !1;
		$(".bottom-comment-box").show();
		$(".bottom-comment-box .input-box").focus();
		$(".page-body").removeClass("hasTabBottom");
		n()
	});
	$(".bottom-comment-box .input-box").blur(function() {
		powerEntity.allowSpeak && "ended" !== liveStatus && 1 > $(".isShow").length && ($(".bottom-comment-box").hide(), $(".page-body").addClass("hasTabBottom"))
	});
	$(document).on("click", ".isdan_btn_new,.barrage_tab,.allcount.btn-visit-commnet", function() {
		if (br) br = !1, $(".barrage_control").removeClass("on"), $(".black_bar .btn_tab_1").addClass("icon_back_2").removeClass("icon_enter_2"), $(".danmuBox").hide(), $(".danmulist").html("");
		else {
			br = !0;
			var a = "";
			0 < $(".comment_dd").eq(2).length && 0 >= $(".danmulist dd[attr-id='" + $(".comment_dd").eq(2).attr("attr-id") + "']").length && (a += '<dd attr-id="' + $(".comment_dd").eq(2).attr("attr-id") + '" attr-time="' + $(".comment_dd").eq(0).attr("attr-time") + '"><i><img src="' + $(".comment_dd").eq(2).find(".avatar img").attr("src") + '">' + (0 < $(".comment_dd").eq(2).find(".vip-logo").length ? '<span class="vip-logo"></span>' : "") + "</i><p>" + $(".comment_dd").eq(2).find(".content").html() + "</p></dd>");
			0 < $(".comment_dd").eq(1).length && 0 >= $(".danmulist dd[attr-id='" + $(".comment_dd").eq(1).attr("attr-id") + "']").length && (a += '<dd attr-id="' + $(".comment_dd").eq(1).attr("attr-id") + '" attr-time="' + $(".comment_dd").eq(0).attr("attr-time") + '"><i><img src="' + $(".comment_dd").eq(1).find(".avatar img").attr("src") + '">' + (0 < $(".comment_dd").eq(1).find(".vip-logo").length ? '<span class="vip-logo"></span>' : "") + "</i><p>" + $(".comment_dd").eq(1).find(".content").html() + "</p></dd>");
			0 < $(".comment_dd").eq(0).length && 0 >= $(".danmulist dd[attr-id='" + $(".comment_dd").eq(0).attr("attr-id") + "']").length && (a += '<dd attr-id="' + $(".comment_dd").eq(0).attr("attr-id") + '" attr-time="' + $(".comment_dd").eq(0).attr("attr-time") + '"><i><img src="' + $(".comment_dd").eq(0).find(".avatar img").attr("src") + '">' + (0 < $(".comment_dd").eq(0).find(".vip-logo").length ? '<span class="vip-logo"></span>' : "") + "</i><p>" + $(".comment_dd").eq(0).find(".content").html() + "</p></dd>");
			$(".danmulist").append(a);
			$(".barrage_control").addClass("on");
			$(".black_bar .btn_tab_1").addClass("icon_enter_2").removeClass("icon_back_2");
			$(".danmuBox").show()
		}
	});
	var bs = [],
		ib = !1,
		Sb = 5500,
		La = 0 < $(".hideLkMoney").length ? !0 : !1,
		Va = !0;
	$(document).on("click", ".ql_start_remind,.set_remind", function() {
		function a() {
			$(".btn_follow_live").addClass("on");
			$(".ql-s-bottom").addClass("on");
			$(".close_elt").text("直接进入")
		}
		if (isFollowedThird)"Y" != isFocus ? followLive("no", "", function() {
			a()
		}) : "Y" != alertStatus && updateAlert("Y", liveId, function() {
			a()
		}), "Y" != isAuthTopic && "public" == topicType && joinTopic(shareKey, topicId, function() {
			a()
		});
		else if (0 < $("#loginbtn").length) $("#loginbtn").click();
		else {
			var b = "N";
			/.*recommend.*/.test(sessionStorage.getItem("trace_page")) && (b = "Y");
			$.ajax({
				type: "POST",
				url: "/live/getQr.htm",
				data: {
					channel: "101",
					topicId: topicId,
					showQl: b
				},
				success: function(a) {
					"200" == a.statusCode ? ($(".focusPic").attr("src", a.msg), qlSlBoxShow(".focusQr2Box")) : $(document).minTipsBox({
						tipsContent: a.msg,
						tipsTime: 1
					})
				},
				error: function() {
					$(document).minTipsBox({
						tipsContent: data.msg,
						tipsTime: 1
					})
				}
			})
		}
	});
	var bt = currentTimeMillis > startTime ? currentTimeMillis + 36E5 : startTime;
	0 < $(".pptMode").length && ac("Y", Bc);
	(function() {
		"ended" != liveStatus && (currentTimeMillis <= startTime + 72E5 || powerEntity.allowSpeak) ? x(bt, "30", "before", function() {
			O = !0;
			moveToEnd($(".speakContentBox"), !0);
			Xa("one");
			setTimeout(function() {
				0 < $(".recordingMsg").length && 1 > $(".isPlaying").length && !powerEntity.allowSpeak && ca($(".recordingMsg").last(), "autoPlayLast")
			}, 1E3)
		}) : lastVisit[topicId] && /^(\d)*$/gi.test(lastVisit[topicId].speakTime) ? (liveFakeStatus = "ended", $("#speakBubbles").append('<dt class="lastVisit_dt"><b>上次看到这里了</b></dt>'), x(lastVisit[topicId].speakTime, "30", "after", function() {
			$(".loadingBox").hide();
			Xa("one");
			setTimeout(function() {
				0 < $(".recordingMsg").length && 1 > $(".isPlaying").length && ca($(".recordingMsg").eq(0), "autoPlayVisit")
			}, 1E3);
			$(".speakContentBox").stop().animate({
				scrollTop: 20
			}, 500)
		})) : (liveFakeStatus = "ended", x("1120752000000", "30", "after", function() {
			$(".loadingBox").hide();
			setTimeout(function() {
				0 < $(".recordingMsg").length && 1 > $(".isPlaying").length && ca($(".recordingMsg").eq(0), "autoPlayFirst")
			}, 350)
		}))
	})();
	window.onload = function() {
		var a = 0 === $("#ppt_window .slide").length && !1 === powerEntity.allowSpeak;
		a && ($(".speakContentBox").css({
			top: "0px"
		}), $(".speakBox").addClass("hidePPT"));
		var b = !localStorage.getItem("ppt_guide") && (!0 === powerEntity.allowSpeak || !$(".speakBox").hasClass("hidePPT"));
		0 < $(".pptMode").length && (a || Ka(), b && $(".ppt_guide").show());
		isRecording = !0;
		if (r || v) try {
			noSleep.enable()
		} catch (f) {}
		if (powerEntity.allowSpeak && !r && !v) {
			var a = document.createElement("script"),
				b = document.createElement("script"),
				c = document.createElement("script"),
				e = document.createElement("link");
			a.src = "/scripts/flashWavRecorder/swfobject.js?v=pcRecUpdateRate";
			b.src = "/scripts/flashWavRecorder/recorder.js?v=pcRecUpdateRate";
			c.src = "/scripts/flashWavRecorder/main.js?v=pcRecUpdateRate";
			e.href = "/styles/flashWavRecorder/css/style.css";
			var d = document.getElementsByTagName("script")[7];
			d.parentNode.insertBefore(e, d);
			d.parentNode.insertBefore(a, d);
			d.parentNode.insertBefore(b, d);
			setTimeout(function() {
				d.parentNode.insertBefore(c, d)
			}, 200)
		}
	};
	$(document).on("click", ".commentManage", function() {
		$(".commentManageTab").hide();
		$(this).find(".commentManageTab").show()
	}).on("click", ".shutUpSet", function() {
		var a = $(this),
			b = $(this).parents(".comment_dd"),
			c = b.attr("attr-createby"),
			e = b.attr("attr-id");
		$(document).popBox({
			boxContent: "<i style='display:block;text-align:left;font-size:1.4rem;'>禁言后，此用户在此直播间不能发布任何评论，同时会删除此评论  </i><i style='display:block;text-align:left;font-size:1.4rem;'>也可在直播间设置页面管理禁言用户</i> <br>确定禁言？",
			btnType: "both",
			confirmFunction: function() {
				$(".loadingBox").show();
				Fb(c, function() {
					a.parents(".commentManageTab").hide();
					Db(e, c, function() {
						a.parents(".comment_dd").remove()
					})
				})
			}
		})
	});
	$(document).on("click", "#commentDl dd", function(a) {
		"commentManage" != a.target.className && $(".commentManageTab").hide()
	});
	$(document).on("click", ".caozuo_shutup", function() {
		$(".shutupBox").show()
	});
	$(document).on("click", "#allShutup", function() {
		var a = "",
			a = $("#allShutup").hasClass("swon") ? "N" : "Y";
		$.ajax({
			type: "POST",
			url: "/live/topic/updateBanned.htm",
			data: {
				isBanned: a,
				topicId: topicId
			},
			success: function(b) {
				"200" == b.statusCode ? ($(document).minTipsBox({
					tipsContent: "设置成功",
					tipsTime: 1
				}), Tb(a)) : $(document).minTipsBox({
					tipsContent: b.msg,
					tipsTime: 1
				});
				$(".loadingBox").hide()
			}
		})
	});
	!
	function() {
		if (0 < $(".setTagBox").length) {
			var a = Number(window.userId);
			$(document).on("click", ".head_portrait", function() {
				Number($(this).parent().attr("attr-createby")) === a && powerEntity.allowSpeak && $(".editBox").show()
			}).on("click", "#editMyInfo", function() {
				window.location.href = "/editUserInfo.htm?target=topic&topicId=" + window.topicId
			}).on("click", "#editMyTitle", function() {
				showBottomBox(".setTag")
			}).on("click", ".setTag dd", function() {
				$(this).addClass("active").siblings().removeClass("active");
				$(".loadingBox").show();
				var a = $(this).attr("attr-title"),
					c = $(this).attr("attr-role");
				$.ajax({
					type: "POST",
					url: "/live/invite/topicModify.htm",
					data: {
						topicInviteId: window.currentUserId,
						role: c,
						liveId: window.liveId,
						title: a,
						topicId: window.topicId
					},
					success: function(b) {
						var c = b.state;
						"200" == c.code ? ($(document).minTipsBox({
							tipsContent: b.data,
							tipsTime: 1
						}), hideBottomBox(".setTag"), $(".userrole").text(a)) : $(document).minTipsBox({
							tipsContent: c.msg,
							tipsTime: 1
						})
					},
					error: function() {
						$(document).minTipsBox({
							tipsContent: "请求出错",
							tipsTime: 1
						})
					},
					complete: function() {
						$(".loadingBox").hide()
					}
				})
			}).on("click", ".editBox .close", function() {
				$(".editBox").hide()
			})
		}
	}();
	$(document).on("click", ".caozuo_remote_file", function() {
		window.location.href = ""
	});
	$(document).on("click", ".caozuo_gift", function() {
		$(".giftBox").show()
	});
	$(document).on("click", "#giftSwitch", function() {
		var a = "";
		$("#giftSwitch").toggleClass("swon");
		a = $("#giftSwitch").hasClass("swon") ? "Y" : "N";
		$.ajax({
			type: "POST",
			url: "/live/gift/change.htm",
			data: {
				status: a,
				topicId: topicId
			},
			success: function(a) {
				200 === a.state.code ? $(document).minTipsBox({
					tipsContent: "设置成功",
					tipsTime: 1
				}) : $(document).minTipsBox({
					tipsContent: a.state.msg,
					tipsTime: 1
				})
			},
			complete: function() {
				$(".loadingBox").hide()
			}
		})
	});
	$(document).on("click", ".shoucang_btn", function() {
		$(".collecttips").toggle();
		$(".backtips").hide()
	});
	$(document).on("click", ".backlisten_btn", function() {
		r ? $(".backtips").html("点击<i class='qlbmi_backtips_i1'></i>在Safari中打开，进行后台收听") : v && $(".backtips").html("点击<i class='qlbmi_backtips_i2'></i>在浏览器中打开，进行后台收听");
		$(".backtips").toggle();
		$(".collecttips").hide()
	});
	var bu = !0;
	$(document).on("click", ".getrecord_btn_0", function() {
		0 < $(".btn_finish_live").length ? $(document).popBox({
			boxContent: "结束直播后才能导出",
			btnType: "cancel",
			cancelName: "知道了"
		}) : bu && (bu = !1, $.ajax({
			type: "POST",
			url: "/live/topic/assemblyAudio.htm",
			data: {
				topicId: topicId
			},
			success: function(a) {
				"200" == a.statusCode ? ("3" == a.assemblyStatus ? $(document).popBox({
					boxContent: "本次直播没有语音",
					btnType: "cancel",
					cancelName: "知道了"
				}) : r || v ? sa("语音合成中，大概需要20分钟", "<li>1.请打开微信电脑客户端</li><li>2.进入此直播的页面</li><li>3.点击此按钮，即可下载音频</li><li>（只支持合成千聊录音的音频，不支持上传音频合成）</li>", "N") : sa("语音合成中，大概需要20分钟", "<li>导出请求已发送，后台正在合成语音</li><li>请20分钟后返回此页面</li><li>点击此按钮下载</li><li>（只支持合成千聊录音的音频，不支持上传音频合成）</li>", "N"), $(".getrecord_btn_0").addClass("getrecord_btn_" + a.assemblyStatus).removeClass("getrecord_btn_0"), bu = !0, 0 < $(".getrecord_btn_2").length
        && $(".getrecord_btn_2 i").html("语音合成中")) : ($(document).minTipsBox({
					tipsContent: a.msg,
					tipsTime: 1
				}), bu = !0)
			},
			error: function() {
				$(document).minTipsBox({
					tipsContent: data.msg,
					tipsTime: 1
				});
				bu = !0
			}
		}))
	}).on("click", ".getrecord_btn_3", function() {
		$(document).popBox({
			boxContent: "本次直播没有语音",
			btnType: "cancel",
			cancelName: "知道了"
		})
	}).on("click", ".getrecord_btn_4", function() {
		$(document).popBox({
			boxContent: "自动合成失败，请重新尝试",
			btnType: "cancel",
			cancelName: "知道了"
		});
		$(".getrecord_btn_4").addClass("getrecord_btn_0").removeClass("getrecord_btn_4")
	});
	0 < $(".getrecord_btn_2").length && ($(".getrecord_btn_2 i").html("语音合成中"), $(document).on("click", ".getrecord_btn_2", function() {
		r || v ? sa("语音合成中，大概需要20分钟", "<li>1.请打开微信电脑客户端</li><li>2.进入此直播的页面</li><li>3.点击此按钮，即可下载音频</li><li>（只支持合成千聊录音的音频，不支持上传音频合成）</li>", "N") : sa("语音合成中，大概需要20分钟", "<li>导出请求已发送，后台正在合成语音</li><li>请20分钟后返回此页面</li><li>点击此按钮下载</li><li>（只支持合成千聊录音的音频，不支持上传音频合成）</li>", "N")
	}));
	0 < $(".getrecord_btn_1").length && (r || v ? ($(".getrecord_btn_1").attr("href", "javascript:;"), $(".getrecord_btn_1 i").html("下载语音"), $(document).on("click", ".getrecord_btn_1", function() {
		sa("语音已经合成好", "<li>1.请打开微信电脑客户端</li><li>2.进入此直播的页面</li><li>3.点击此按钮，即可下载音频</li><li>（只支持合成千聊录音的音频，不支持上传音频合成）</li>", "Y")
	})) : (isWeixin(), $(".getrecord_btn_1 i").html("下载语音")));
	$("#btnShowMoney").click(function() {
		var a = $(this).hasClass("swon") ? "N" : "Y";
		quickAjax("POST", "/live/topic/barrageFlag.htm", {
			topicId: topicId,
			status: a
		}, function() {
			Ub("N" != a)
		})
	});
	$(document).on("click", ".btnFristMsg", function() {
		0 < $(".qlTimerShow").length ? ($(".speakContentBox").stop().animate({
			scrollTop: 0
		}, 500), alertMsg("已回到第一条内容", 1)) : Q && ($(".loadingBox").show(), $("#BubblesTemp").html(""), $("#speakBubbles").html(""), m.pause(), x("1120752000000", "30", "after", function() {
			$(".loadingBox").hide();
			setTimeout(function() {
				20 > $("#speakBubbles").children(".left_bubble,.luckyMoney").length ? (O = !0, liveFakeStatus = liveStatus) : (O = !1, liveFakeStatus = "ended");
				alertMsg("已回到第一条内容", 1)
			}, 300);
			$(".speakContentBox").stop().animate({
				scrollTop: 0
			}, 300)
		}))
	});
	$(document).on("click", ".btn_new_msg", function() {
		O ? (moveToEnd($(".speakContentBox"), !0), setTimeout(function() {
			alertMsg("已到达最后一条内容", 1)
		}, 500)) : Q && ($("#qr_bubbles_item").hide(), Ua(function() {
			setTimeout(function() {
				alertMsg("已到达最后一条内容", 1)
			}, 1E3)
		}))
	});
	$(".close_elt").click(function() {
		$(".enterLiveTips").hide()
	});
	$(document).on("click", ".whisper_div i", function() {
		$(".whisperTipsBox").show()
	});
	$(document).on("click", ".isWhisper .content_q i", function() {
		var a = $(this).parents(".whisperDd").attr("attr-commentId");
		vc(a)
	});
	var bv = !0,
		N, Wb, ua, Ma = !0,
		T = !0;
	$(document).on("click", ".audio_box_play", function() {
		var a = $(this);
		payForListenItem = $(this).parents(".wl_msg_item");
		if ($(this).parents(".audio_box").hasClass("isWhisperPlay")) jb();
		else if ($(this).attr("attr-wsUrl") && "" != $(this).attr("attr-wsUrl")) Vb(a);
		else if ("点击播放" == $(this).siblings("p").text()) N.play(), N.pause(), wc(a);
		else if ("未公开" == $(this).siblings("p").text()) $(document).minTipsBox({
			tipsContent: "私密问题，不能旁听",
			tipsTime: 1
		});
		else {
			N.play();
			N.pause();
			var b = a.parents(".wl_msg_item").attr("attr-answer"),
				c = a.parents(".wl_msg_item").attr("attr-askid"),
				a = a.parents(".wl_msg_item").attr("attr-id");
			M = "LISTEN";
			T && (T = !1, $(".loadingBox").show(), Ga("LISTEN", b, 100, a, c, "Y"))
		}
	});
	0 < $("#qlWhisperPlayer").length && (N = document.getElementById("qlWhisperPlayer"), N.addEventListener("ended", function() {
		jb()
	}, !1));
	$(".whisperShowBox .qlMT_close").click(function() {
		jb()
	});
	0 < $(".enterFocusQr").length && getFocusQrFunction(".enterFocusQr", "110", topicId, liveId);
	var bw = !0;
	$(document).on("click", ".focusLiveBtnClose", function() {
		bw && $(".enterLiveTips .focusLiveBtn").hasClass("on") && (bw = !1, $(".loadingBox").show(), $.ajax({
			type: "POST",
			url: "/live/savefocus.htm",
			data: {
				cancleFlag: "no",
				topicId: topicId,
				liveId: liveId
			},
			success: function(a) {
				bw = !0;
				$(".loadingBox").hide();
				"200" == a.statusCode ? ($(".btn_follow_live").trigger("click"), $(document).minTipsBox({
					tipsContent: "关注成功",
					tipsTime: 1
				}), _qla && _qla("event", {
					category: "followLive",
					action: "success",
					cancleFlag: "no"
				})) : ($(document).minTipsBox({
					tipsContent: a.msg,
					tipsTime: 1
				}), _qla && _qla("event", {
					category: "followLive",
					action: "failed",
					cancleFlag: "no"
				}))
			},
			error: function() {
				bw = !0;
				$(".loadingBox").hide();
				_qla && _qla("event", {
					category: "followLive",
					action: "failed",
					cancleFlag: "no"
				})
			}
		}))
	}).on("click", ".focusLiveBtn", function() {
		$(this).hasClass("on") ? $(".focusLiveBtn").removeClass("on") : $(".focusLiveBtn").addClass("on")
	});
	$(document).on("click", ".btn_follow_live,.btn_follow_live_2", function(a) {
		a.stopPropagation();
		a.preventDefault();
		$(this);
		followLive("no", "", function() {
			$(".btn_follow_live").remove();
			$(".top_follow_tips").remove();
			$(document).minTipsBox({
				tipsContent: "关注成功",
				tipsTime: 1
			});
			if (1 != window.qlsubscribe) {
				console.log("没有关注千聊，弹出千聊二维码");
				var a = new aa("#fansnowball2", "204", "Y");
				a.showModel()
			} else window.isFollowedThird || (console.log("没有关注三方，弹出三方二维码"), a = new aa("#fansnowball2", "101", "N"), a.showModel())
		})
	});
	$(document).on("click", ".close_tips", function() {
		$(".top_follow_tips").remove();
		rememberCloseTipsList(topicId)
	});
	$(".btn_mLibrary").click(function() {
		bx && (bx = !1, ac("", Xb));
		$("#ppt-select-layer").addClass("on")
	});
	$("#ppt-close-btn").click(Zb);
	$(document).on("click", ".ppt-select-list .up", function() {
		var a = $(this).parents("li.webkitBox"),
			b = a.prev(),
			c = a.find(".image-content").attr("data-id"),
			d = a.index() + 1,
			l = b.index() + 1;
		$b(c, d, l, function() {
			0 < b.length && (b.before(a), a.find(".image-content").attr("data-sortNum", l), b.find(".image-content").attr("data-sortNum", d))
		})
	});
	$(document).on("click", ".ppt-select-list .down", function() {
		var a = $(this).parents("li.webkitBox"),
			b = a.next("li.webkitBox"),
			c = a.find(".image-content").attr("data-id"),
			d = a.index() + 1,
			l = b.index() + 1;
		$b(c, d, l, function() {
			0 < b.length && (b.after(a), a.find(".image-content").attr("data-sortNum", l), b.find(".image-content").attr("data-sortNum", d))
		})
	});
	$(document).on("click", ".ppt-select-list .delete", function() {
		function a(a) {
			a = {
				id: a
			};
			$(".loadingBox").show();
			$.ajax({
				type: "POST",
				url: "/live/topic/removefile.htm",
				data: JSON.stringify(a),
				contentType: "application/json; charset=utf-8",
				dataType: "json",
				success: function(a) {
					$(".loadingBox").hide();
					200 === a.state.code ? (b.remove(), updateUnsentImgCount(), 0 < $("#ppt_slider [data-id=" + a.data.id + "]").length && (a = $("#ppt_slider [data-id=" + a.data.id + "]").index(), K.removeSlide(a))) : alertMsg(a.state.code)
				},
				error: function(a) {
					$(".loadingBox").hide();
					alertMsg(a.state.code)
				}
			})
		}
		var b = $(this).parents("li.webkitBox"),
			c = b.find(".image-content").attr("data-id");
		0 < $("#ppt_slider").length && "Y" == b.find(".image-content").attr("data-status") ? $(document).popBox({
			topContent: "删除素材",
			boxContent: "此PPT已使用，请撤回后再删除",
			btnType: "cancel",
			cancelName: "关闭"
		}) : $(document).popBox({
			topContent: "删除素材",
			boxContent: "是否确定删除素材",
			btnType: "both",
			confirmFunction: function() {
				a(c)
			}
		})
	});
	if (0 < $(".pptMode").length) $(document).on("click", ".ppt-select-list .image-content", yc);
	else $(document).on("click", ".ppt-select-list .image-content", zc);
	r || v ? $("#ppt-add-btn").click(xc) : 0 < $("#ppt-add-btn").length && new imgUpload($("#ppt-add-btn"), {
		folder: "liveComment",
		multiple: "Y",
		onComplete: function(a) {
			Bb("pc", a, "N")
		},
		onChange: function() {
			$(".loadingBox").show()
		},
		onError: function() {
			$(".loadingBox").hide()
		}
	});
	var bx = !0,
		fa = !0,
		lb = !0,
		nb;
	$(document).on("click", ".handle-content .return", function() {
		0 < $("#ppt_slider .slide").length && (nb = $(this).attr("data-id"), $(document).popBox({
			topContent: "删除素材",
			boxContent: "是否确定撤回图片",
			btnType: "both",
			confirmFunction: Ac
		}))
	});
	var by = !1,
		K, Oa = !0;
	$(".ppt_guide").click(function() {
		$(this).hide();
		localStorage.setItem("ppt_guide", "Y")
	});
	$(".tabNowhisper").click(function() {
		alertMsg("Ta没有开启私问")
	});
	$(".myShareCard").click(function(a) {
		function b(a) {
			var b = !1;
			return function(c) {
				b || (b = !0, $.ajax({
					type: "POST",
					url: "/topic/share/saveshare.htm",
					contentType: "application/json",
					data: JSON.stringify({
						businessId: topicId,
						type: "topic",
						joinType: window.joinType
					}),
					success: function(b) {
						a && a(b)
					},
					error: function(a) {
						c && c(a);
						$(document).minTipsBox({
							tipsContent: a.msg,
							tipsTime: 1
						})
					},
					complete: function() {
						b = !1
					}
				}))
			}
		}
		"charge" === window.topicType ? window.isShareAuth ? window.location.href = "/topic/share/shareinviter/" + window.topicId + ".htm?type=topic&shareKey=" + window.myShareKey + "&joinType=auth" : "" != lshareKey ? window.location.href = "/topic/share/myShareCardTemplate.htm?type=topic&shareKey=" + window.lshareKey + "&topicId=" + window.topicId + "&liveId=" + window.liveId : "auto" === window.joinType ? b(function(a) {
			window.location.href = "/topic/share/shareCardTemplate.htm?shareType=topic&type=0&shareKey=" + a.data.myShareKey
		})() : "auth" === window.joinType && (window.location.href = "/topic/share/myShareCardTemplate.htm?liveId=" + window.liveId + "&topicId=" + window.topicId + "&type=topic") : b(function(a) {
			window.location.href = "/topic/share/shareCardTemplate.htm?shareType=topic&type=0&shareKey=" + a.data.shareKey
		})();
		a.stopPropagation()
	});
	la();
	var w = !0;
	$(document).on("click", "#btnAddMic", function() {
		bz(function() {
			qlSlBoxShow("#setMicBox")
		}, function(a) {
			$(document).popBox({
				boxContent: "发起新上麦后，将结束上一轮发言",
				btnType: "tran",
				confirmName: "发起新上麦",
				cancelName: "取消",
				confirmFunction: function() {
					cc(function() {
						$("#btnAddMic").click()
					})
				}
			})
		})
	}).on("click", "#setMicBox .tlbtn_confirm", function() {
		var a = $("#setMicNum").val() || 5;
		isNumberValid(a, 1, 100, "上麦数") && w && (w = !1, $.ajax({
			type: "POST",
			url: "/live/mic/begin.htm",
			data: {
				topicId: topicId,
				maxTime: a
			},
			success: function(a) {
				w = !0;
				200 === a.state.code ? ($("#setMicBox").hide(), la()) : alertMsg(a.state.msg)
			},
			error: function(a) {
				w = !0
			}
		}))
	});
	$(document).on("click", "#micHandel", function() {
		qlSlBoxShow(".waitMicBox")
	});
	$(document).on("click", "#micOverBtn", function() {
		$(document).popBox({
			boxContent: "确定要结束本轮发言？",
			btnType: "both",
			confirmFunction: function() {
				cc()
			}
		})
	});
	$(document).on("click", "#waitMicTable .btn-mic-up", function() {
		var a = $(this),
			b = $(this).parents("tr").attr("data-userid");
		w && (w = !1, $.ajax({
			type: "POST",
			url: "/live/mic/start.htm",
			data: {
				topicId: topicId,
				userId: b
			},
			success: function(b) {
				w = !0;
				200 === b.state.code ? (a.addClass("btn-mic-over").removeClass("btn-mic-up").html("结束"), a.parents("tr").find(".listMicStatus").html("正在上麦中")) : alertMsg(b.state.msg)
			},
			error: function(a) {
				w = !0
			}
		}))
	}).on("click", "#waitMicTable .btn-mic-xu", function() {
		var a = $(this),
			b = $(this).parents("tr").attr("data-userid");
		w && (w = !1, $.ajax({
			type: "POST",
			url: "/live/mic/continue.htm",
			data: {
				topicId: topicId,
				userId: b
			},
			success: function(b) {
				w = !0;
				200 === b.state.code ? (a.addClass("btn-mic-over").removeClass("btn-mic-xu").html("结束"), a.parents("tr").find(".listMicStatus").html("正在上麦中")) : alertMsg(b.state.msg)
			},
			error: function(a) {
				w = !0
			}
		}))
	}).on("click", "#waitMicTable .btn-mic-over", function() {
		var a = $(this),
			b = $(this).parents("tr").attr("data-userid"),
			c = $(this).parents("tr").find(".listMicName").html();
		ec(b, c, function() {
			a.addClass("btn-mic-xu").removeClass("btn-mic-over").html("续麦");
			a.parents("tr").find(".listMicStatus").html("已结束")
		})
	}).on("click", ".btn-stop-on-mic", function() {
		$(this);
		var a = $(this).parents("dd").attr("attr-createby"),
			b = $(this).parents("dd").find(".speaker_name b").html();
		ec(a, b)
	});
	$(document).on("click", ".waitMicBox .qlMT_close2", function() {
		dc()
	});
	$(document).on("click", ".mic-start", function() {
		powerEntity.allowSpeak || powerEntity.allowMGLive ? qlSlBoxShow(".waitMicBox") : ($(".getMicBox .qlMT_content").addClass("get-mic-btnbox"), qlSlBoxShow(".getMicBox"))
	}).on("click", ".mic-end", function() {
		alertMsg("该轮上麦发言已结束")
	}).on("click", ".mic-end-new", function() {
		powerEntity.allowSpeak || powerEntity.allowMGLive ? alertMsg("您的身份不可以抢麦") : alertMsg("抢麦已结束")
	}).on("click", "#getMicBtn", function() {
		w && (w = !1, $.ajax({
			type: "POST",
			url: "/live/mic/get.htm",
			data: {
				topicId: topicId
			},
			success: function(a) {
				w = !0;
				200 === a.state.code ? (w = !0, alertMsg("抢麦成功"), $(".getMicBox").hide(), ob(), setTimeout(function() {
					$(".tab_voice").click()
				}, 500)) : alertMsg(a.state.msg)
			},
			error: function(a) {
				w = !0
			}
		}))
	});
	$(document).on("click", ".giveUpMic", function() {
		$(document).popBox({
			boxContent: "确定放弃上麦？",
			btnType: "both",
			confirmFunction: function() {
				gc("out")
			}
		})
	});
	var bz = function(a, b) {
			$.ajax({
				type: "POST",
				url: "/live/mic/canbegin.htm",
				data: {
					topicId: topicId
				},
				success: function(c) {
					200 === c.state.code ? a && a() : b && b(c.state.msg)
				},
				error: function(a) {}
			})
		},
		ha = "",
		pb = "",
		aa = function(a, b, c) {
			this.channel = b;
			this.showQr = c;
			this.selector = a;
			this.init()
		};
	aa.prototype = {
		init: function() {
			this.initElem();
			this.initEventListener();
			this.getQrcode()
		},
		initElem: function() {
			this.$model = $(this.selector);
			this.$bg = this.$model.children(".bg");
			this.$close = this.$model.find(".close");
			this.$img = this.$model.find("#ql-qrcode")
		},
		initEventListener: function() {
			this.$bg.click(this.removeModel.bind(this));
			this.$close.click(this.removeModel.bind(this))
		},
		getQrcode: function() {
			var a = this;
			$.ajax({
				type: "POST",
				url: "/live/getQr.htm",
				data: {
					channel: this.channel,
					topicId: topicId,
					channelId: channelId,
					showQl: this.showQr
				},
				success: function(b) {
					"200" == b.statusCode ? a.$img.attr("src", b.msg) : $(document).minTipsBox({
						tipsContent: b.msg,
						tipsTime: 1
					})
				},
				error: function() {
					$(document).minTipsBox({
						tipsContent: data.msg,
						tipsTime: 1
					})
				}
			})
		},
		showModel: function() {
			this.$model.show()
		},
		removeModel: function() {
			this.$model.hide()
		}
	};
	var bA = location.search,
		C;
	!powerEntity.allowDelSpeak && currentTimeMillis < startTime && "ended" != liveStatus && "Y" == j && !/from=kaifang/.test(bA) && (isBindThird ? isFollowedThird || /.*recommend.*/.test(sessionStorage.getItem("trace_page")) ? (C = new aa("#fansnowball", "203", "Y"), C.showModel(), C.$model.find(".qrcode-container").hide(), C.$model.find("#focus-tip").text("开播前15分钟会自动发消息通知你")) : (C = new aa("#fansnowball", "203", "N"), C.showModel(), C.$model.find("#focus-tip").text("长按二维码关注下次开课会通知你")) : "1" == qlsubscribe ? (C = new aa("#fansnowball", "203", "Y"), C.showModel(), C.$model.find(".qrcode-container").hide(), C.$model.find("#focus-tip").text("开播前15分钟会自动发消息通知你")) : (C = new aa("#fansnowball", "203", "Y"), C.showModel(), C.$model.find("#focus-tip").text("扫码开启双重提醒服务，从此不怕漏听课程")))
});
var isBarDragging = !1;
$("#audioPlayer").on("loadedmetadata", function(d) {
	var h = $(this)[0];
	d = $(".isPlaying .audio-bar-area");
	var p = d.find(".block"),
		n = d.find(".front-bar"),
		q = Number(d.width()) - 3;
	$(this).on("timeupdate", function() {
		$(".isPlaying").removeClass("audioloading");
		if (!isBarDragging) {
			percent = (Number(h.currentTime) / Number(h.duration)).toFixed(2);
			var d = q * percent;
			d > q && (d = q);
			percent = d / q;
			var x = q * percent;
			p.css("left", d + "px");
			n.css("width", x + "px")
		}
	});
	$(this).on("ended, emptied", function() {
		$(this).off("timeupdate");
		p.attr("style", "");
		n.attr("style", "")
	})
});

function startHandle() {}

function moveHandle() {}

function endHandle() {}
$(document).on("mousedown", ".audio-bar-area .block", function(d) {
	d.stopPropagation();
	var h = $("#audioPlayer")[0],
		p = $(this).parents(".bubble_content").find(".audio_info").attr("attr-src").replace(/.*\//, "").replace(/\..*/, ""),
		n = h.currentSrc.replace(/.*\//, "").replace(/\..*/, ""),
		p = p === n;
	if ($(this).parents(".bubble_content").hasClass("isPlaying") || p) {
		isBarDragging = !0;
		var p = $(this).parents(".audio-bar-area"),
			q = $(this),
			D = p.find(".front-bar"),
			x = Number(q.data("second")),
			ja = Number(h.duration);
		q.data("current").replace("″", "");
		var R;
		R = isAndroid() || isiOS() ? d.originalEvent.touches[0].pageX : d.originalEvent.pageX;
		var a = Number(q.css("left").replace("px", "")),
			y = Number(p.width() - 3);
		q.addClass("active");
		var B;
		$(document).on("mousemove", function(d) {
			d.stopPropagation();
			d = isAndroid() || isiOS() ? d.originalEvent.touches[0].pageX : d.originalEvent.pageX;
			d = a + (d - R);
			0 > d && (d = 0);
			d > y && (d = y);
			B = d / (y - 0);
			var l = (x * B).toFixed(0);
			q.css("left", d + "px");
			D.css("width", String(y * B) + "px");
			0 <= l && l <= x && q.attr("data-current", convertSecond(l))
		});
		$(document).on("mouseup", function(d) {
			d.stopPropagation();
			q.removeClass("active");
			$(document).off("mousemove");
			d = Number((ja * B).toFixed(3));
			isNaN(d) || (h.currentTime = d);
			isBarDragging = !1;
			$(document).off("mouseup");
			return !1
		});
		return !1
	}
});
$(document).on("touchstart", ".audio-bar-area .block", function(d) {
	d.stopPropagation();
	var h = $("#audioPlayer")[0],
		p = $(this).parents(".bubble_content").find(".audio_info").attr("attr-src").replace(/.*\//, "").replace(/\..*/, ""),
		n = h.currentSrc.replace(/.*\//, "").replace(/\..*/, ""),
		p = p === n;
	if ($(this).parents(".bubble_content").hasClass("isPlaying") || p) {
		isBarDragging = !0;
		var p = $(this).parents(".audio-bar-area"),
			q = $(this),
			D = p.find(".front-bar"),
			x = Number(q.data("second")),
			ja = Number(h.duration);
		q.data("current").replace("″", "");
		var R;
		R = isAndroid() || isiOS() ? d.originalEvent.touches[0].pageX : d.originalEvent.pageX;
		var a = Number(q.css("left").replace("px", "")),
			y = Number(p.width() - 3);
		q.addClass("active");
		var B;
		$(document).on("touchmove", function(d) {
			d.stopPropagation();
			d = isAndroid() || isiOS() ? d.originalEvent.touches[0].pageX : d.originalEvent.pageX;
			d = a + (d - R);
			0 > d && (d = 0);
			d > y && (d = y);
			B = d / (y - 0);
			var h = (x * B).toFixed(0);
			q.css("left", d + "px");
			D.css("width", String(y * B) + "px");
			0 <= h && h <= x && q.attr("data-current", convertSecond(h))
		});
		$(document).on("touchend", function(d) {
			d.stopPropagation();
			q.removeClass("active");
			$(document).off("touchmove");
			d = Number((ja * B).toFixed(3));
			isNaN(d) || (h.currentTime = d);
			isBarDragging = !1;
			$(document).off("touchend");
			return !1
		});
		return !1
	}
});
$(document).on("click", ".audio-bar-area .block", function(d) {
	d.stopPropagation();
	return !1
}).on("click", ".shareList_dl dd", function() {
	window.location.href = "/topic/share/shareuser/" + window.topicId + ".htm"
});

function Zan(d, h) {
	this.ids = d ? d : [];
	this.maxZan = h ? h : 50
}
Zan.prototype.init = function() {
	$.ajax({
		url: "/interact/speak/likesList.htm",
		method: "POST",
		contentType: "application/x-www-form-urlencoded",
		data: {
			speakIds: this.ids.join(",")
		},
		success: function(d) {
			200 == d.statusCode && d.data.forEach(function(d) {
				zan.updateZan(d.speakId, d.likesNum, d.isLikes)
			})
		}
	})
};
Zan.prototype.setMax = function(d) {
	this.maxZan = d
};
Zan.prototype.addIds = function(d) {
	if (d instanceof Array) this.ids = noRepeatArray(this.ids.cancat(d));
	else if ("number" === typeof d) isContained(this.ids, d) || this.ids.push(d);
	else throw Error("请传入正确的id：Array<number>|number ");
};
Zan.prototype.doZan = function(d) {
	$(".zan[data-id=" + d + "]").hasClass("active") || $.ajax({
		url: "/interact/speak/likes.htm",
		data: {
			speakId: d,
			topicId: window.topicId
		},
		success: function(h) {
			200 == h.statusCode ? zan.updateZan(d, Number(h.data.likesNum), !0) : 1 == h.statusCode ? alertMsg(h.msg) : 300 == h.statusCode && alertMsg("请登录后使用点赞功能")
		}
	})
};
Zan.prototype.updateZan = function(d, h, p) {
	d = $(".zan[data-id=" + d + "]");
	var n = d.parents(".bubble_content");
	!0 === p ? d.addClass("active") : !1 === p && d.removeClass("active");
	h >= this.maxZan ? n.addClass("had_zan") : n.removeClass("had_zan");
	d.find(".count").text(0 === h ? "" : h)
};
!
function() {
	window.zan = new Zan;
	zan.setMax(Number(window.likeLimit));
	$(document).on("click", ".zan", function(d) {
		var h = $(this).attr("data-id");
		window.zan.doZan(h);
		d.stopPropagation()
	})
}();

function noRepeatArray(d) {
	var h = d.length;
	return d.filter(function(p, n) {
		for (n += 1; n < h; n++)
		if (d[n] === p) return !1;
		return !0
	})
}

function isContained(d, h) {
	return d.some(function(d) {
		return d === h
	})
}
var $document = $(document);
$document.on("click", ".ppt-add-all", function() {
	$(this).hasClass("ppt-no-pto") || sendAllImgToPPT()
});
var $pptAddAllBtn = $(".ppt-add-all"),
	$unsentImgCountWrap = $(".ppt-num-unsent-wrap"),
	$unsentImgCount = $(".ppt-num-unsend");

function updateUnsentImgCount() {
	var d = $(".image-content").filter(function() {
		return "N" == $(this).attr("data-status")
	}).length;
	$unsentImgCount.text(d);
	d ? ($pptAddAllBtn.removeClass("ppt-no-pto"), $unsentImgCountWrap.show()) : ($pptAddAllBtn.addClass("ppt-no-pto"), $unsentImgCountWrap.hide())
}

function sendAllImgToPPT() {
	var d = $(".image-content").filter(function() {
		return "N" == $(this).attr("data-status")
	}).map(function() {
		return $(this).data("id").toString()
	});
	d.length ? d = Array.prototype.join.call(d, ",") : alertMsg("亲！已经全部发送了");
	$(".loadingBox").show();
	$.ajax({
		type: "post",
		url: "/live/topic/oneKeyPutAll.htm",
		dataType: "json",
		data: {
			Id: d
		},
		success: function(d) {
			$(".loadingBox").hide();
			200 != d.state.code && alertMsg(d.state.msg)
		}
	})
}
var $goToPlayingItemBtn = $(".go-to-playing-item"),
	$scrollWrap = $(".speakContentBox"),
	goToPlayingItemBtnShowTimer, goToPlayingItemBtnRemoveTimer;

function showBtnToPlayingItem() {
	var d = $(".isReading");
	d.length ? (d = d.offset().top - $scrollWrap.offset().top, (0 > d || d > $scrollWrap.height()) && !goToPlayingItemBtnShowTimer ? (goToPlayingItemBtnRemoveTimer && (clearTimeout(goToPlayingItemBtnRemoveTimer), goToPlayingItemBtnRemoveTimer = ""), goToPlayingItemBtnShowTimer && (clearTimeout(goToPlayingItemBtnShowTimer), goToPlayingItemBtnShowTimer = ""), goToPlayingItemBtnShowTimer = setTimeout(function() {
		$goToPlayingItemBtn.addClass("show")
	}, 500)) : 0 <= d && d <= $scrollWrap.height() && !goToPlayingItemBtnRemoveTimer && (goToPlayingItemBtnShowTimer && (clearTimeout(goToPlayingItemBtnShowTimer), goToPlayingItemBtnShowTimer = ""), goToPlayingItemBtnRemoveTimer && (clearTimeout(goToPlayingItemBtnRemoveTimer), goToPlayingItemBtnRemoveTimer = ""), goToPlayingItemBtnRemoveTimer = setTimeout(function() {
		$goToPlayingItemBtn.removeClass("show")
	}, 500))) : $goToPlayingItemBtn.hasClass("show") && !goToPlayingItemBtnRemoveTimer && (goToPlayingItemBtnShowTimer && (clearTimeout(goToPlayingItemBtnShowTimer), goToPlayingItemBtnShowTimer = ""), goToPlayingItemBtnRemoveTimer = setTimeout(function() {
		$goToPlayingItemBtn.removeClass("show")
	}, 500))
}
$goToPlayingItemBtn.click(function() {
	$(".isReading").length && $scrollWrap.stop().animate({
		scrollTop: $(".isReading").offset().top - $scrollWrap.offset().top + $scrollWrap.scrollTop() - $scrollWrap.height() / 2 + 50
	}, 500)
});
$(document).on("touchmove", "#ppt_slider", function(d) {
	d.preventDefault()
});
